Theoretically, in an ideal world, a human will be able to see his/her life in the long run, and see how enjoyable it shall become. If it's a positive experience, then the person should choose to live it, and face all the obstacles. If the person's life is a negative experience, then the person should kill himself, since life will provide a net deficit rather than a net gain in enjoyment and satisfaction. If life were nothing but a business operation, then selling the business would be a good idea if it was losing money.
This is assuming there are no other variables to consider, such as family members who will be affected by the death. Also, enjoyment and satisfaction of one's life is determined subjectively by that person's mind. Therefore, an individuals preconceptions of the quality of his life are self-fulfilling. If a person thinks his life is crap, then it becomes crap. If a person thinks there is hope, then hope funnels into his/her life through the gaps of opportunity.
However, we then come into the problem of free will vs. determinism. Does a person have the ability to change his mind out of sheer will? Or is it determined by external factors, such as treatment, environmental factors, or genetics? Are the chemicals in our head subject to some kind of control, or does our concscience move as a force of science and nothing more? If our percieved free will is really nothing but a force of science, then the minds of men could be deemed scientifically doomed. This assumption could justify euthanasia outside the boundaries of chronic illness.
Now, before you yell about how people can change and how you dealt with your suicidal problems etc. etc., notice that I used the term "scientifically doomed." It may be impossible to scientifically doom a mind, since the mind is so versatile. People who are bipolar and schizophrenic are subject to impulsive suicide, but are less likely to have a constant desire for suicide unless they are put in very stressful circumstances. Such impulses can be treated with medication. There are many other examples of how a mind cannot be scientifically doomed; use your imagination. However, if it were theoretically possible to scientifically doom a person's mind, to render it hopeless against the forces of self-suffering, then euthanasia can be justified.