HI
I have a point in space, and a plane and im trying to figure out how to find the angle between the two. Not just any angle but the smallest angle.
the plane runs through me, its like seeing a star in the sky and figuring out the angle that star is off the horizon
If i could find the point on the plane closest to the point in space, i could use trig and get the angle easy, but i cant figure out how to find that point on the plane.
any help would be great thanks.
Angle b/t Point and plane
easy one:
projected_point = point - plane.Normal * plane.getDistanceTo(point);
angle = plane.Normal.dotProduct((projected_point - point).normalize());
As you can see there is a simplification possible:
angle = plane.Normal.dotProduct((-(plane.Normal * plane.getDistanceTo(point)) - point).normalize());
projected_point = point - plane.Normal * plane.getDistanceTo(point);
angle = plane.Normal.dotProduct((projected_point - point).normalize());
As you can see there is a simplification possible:
angle = plane.Normal.dotProduct((-(plane.Normal * plane.getDistanceTo(point)) - point).normalize());