As a person suffering from a psychotic disorder, allow me to point out that the case your encounter is not typical of mental illness. For most mental illnesses--psychosis included, which paranoia is often a symptom of--the individual is not significantly more likely to be violent than the average "normal" human being. There is no reason to keep your distance from them--in fact, the mentally ill are so used to being treated subhuman, they're far more likely to distance themselves from you.
Now when it comes to certain personality disorders--antisocial personality disorder in particular--those people are considerably more likely to be violent. But personality disorders are their own thing--they're mental illness, but the don't really fit well with other disorders. For example, antisocial personality disorder--also known as sociopathy or psychopathy in extreme cases--causes the individual to have a greatly reduced amount of empathy, poor ability to think ahead and the inability to feel remorse or learn from their actions. However, even these individuals are not always violent or even criminals--many psychologists believe that a high functioning sociopath is more likely to succeed in business or politics than a person who is capable of grasping that other people exist and matter. In fact, I'd wager a good portion of the world's political leaders are sociopaths (or narcissists); most psychologists tend to agree with that figure.
Now there are symptoms that can mimic sociopathy in the mentally ill. Persons with schizophrenia may suffer from flat affect, which makes them have difficulty expressing emotion (or flat out be unable to). These people will feel numb and indifferent to others in severe cases, but it's distinguished from true lack of empathy in that they are simply unaware of others' feelings, rather than disregarding them.
I do want to point out that while your experience is hardly typical or even common, it does happen. There's a way to tell if the situation might go that way though: look at their past behavior, particularly any behavior before their illness developed (mental illness by and large being something that develops rather than a birth defect)--if they have reacted to stress with violent outbursts in the past, they will likely do so again. Do keep in mind though that some circumstances are more likely to cause a mentally ill person to lash out--attempting to restrain them or otherwise "closing them in" is a very bad idea, as it provokes a fight or flight response. If the person you are talking to is not immediately violent or aggressive and asks to be left alone, do it. If you are worried about them hurting themselves, someone else or getting hurt, call their doctor or psychiatrist.
And always, always remember that even though voices or other hallucinations are not real to you, they are very much real to the patient. This is the same with any disease, mental or physical--tell an individual who is sick or suffering that any symptom isn't real, is in their heads or that they are crazy is just going to make them feel unimportant at best (leading to a risk of self destructive behavior), or outright p*** them off at worst. If a person (whose past behavior you are familiar with and/or trusts you) starts having this kind of symptom and needs to be reassured, tell them they are hallucinating instead. There's a big difference between "Okay, you're hallucinating. I need you to take a deep breath and try to relax, and we can get through this" and "It's all in your head. I need you to take a deep breath and try to relax, and we can get through this."
Remember, if you deliberately antagonize or isolate a mentally ill person, treat them like they're crud/subhuman or walk on tiptoes around them, that's just going to upset them. I mean, you wouldn't do that to a person without a mental illness--it would just be insulting. I've been in situations myself where people who didn't know better attempted to isolate me because they thought psychotic meant dangerous. It frightened me--my immediate response was to flee to a more caring individual, only to be grabbed by the arm and yanked into a room where the very people who had isolated me blocked the doors with their bodies. To say that the situation went to h*** and a hand basket would be an understatement. Had they simply had one person stay with me and attempt to be understanding and another call my mother and my psychiatrist, the whole incident could have been avoided. The only good thing that came from it was that I was hospitalized and correctly diagnosed (I had been labeled as ADHD at the time, and was over medicated for it. That in itself probably didn't help).