3
\$\begingroup\$

Hello i have two points (Vector3) A and B. And have a radius r

enter image description here

How can i find a coords of point P in a circle by angle?

\$\endgroup\$
  • \$\begingroup\$ add point you need to find and angle to picture \$\endgroup\$ – nikoliazekter Jul 13 '15 at 11:32
  • \$\begingroup\$ done. New point P on the picture with angle=130 \$\endgroup\$ – GLeBaTi Jul 13 '15 at 11:46
2
\$\begingroup\$

Solution for 2D vectors:

Vector2 AB = B - A;  // Vector from A to B

Vector2 A0 = r * AB.normalized;  // Vector from A to 0°
Vector2 A90 = new Vector2(A0.y, -A0.x);  // Vector from A to 90°

Vector2 P = A + Sin(alpha) * A90 + Cos(alpha) * A0;  // Coordinate of arbitrary point on a circle

For arbitrary 3D vectors A and B in 3D space you need coordinates of at least one more point on the same plane (but not located on the A-B line).

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.