Hi Guru's...

I have a set of points that may lie along any of the x, y and z axes in a Cartesian coordinate system. I am hoping that a function exists which will determine if any two selected points are on different axes, i.e, if the one of the points is on x and the other on y or z, not elsewhere on the x axis. Put another way, I need to determine if the triangle formed by the two points and the origin lies in the xy, xz or yz planes. This might be as simple as testing if any particular value is zero, i.e. if the x coordinate is zero, then the points must be on the z and y axes and the triangle in the yz plane. But, I'm looking for a fairly general solution, one that also returns the appropriate plane as the answer. Very closely related to this, I could use a function that determines which of the 8 octants a point lies in. Seems like the cross product might be part of this, but I'm a little rusty on how to apply it.

I hope this is clear enough, and someone has a suggestion to point me in the right direction. Before writing my own klunky version, I thought I'd ask.

Thanks, Bryan
****************
Prof. Bryan Hanson
Dept of Chemistry & Biochemistry
DePauw University
602 S. College Ave
Greencastle IN 46135 USA

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to