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\$
2
  • \$\begingroup\$ add point you need to find and angle to picture \$\endgroup\$ Jul 13, 2015 at 11:32
  • \$\begingroup\$ done. New point P on the picture with angle=130 \$\endgroup\$
    – Glebka
    Jul 13, 2015 at 11:46

1 Answer 1

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\$
0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .