[ad_1]
I’m looking for the purpose coordinates on the sting of a circle like this:
I do know:
- The coordinates of Point A
- The coordinates of the centre of the circle (Point B)
- The radius of the circle
I’ve tried the next (the issue is a 2D situation inside a 3D setting, so ‘z’ axis is at all times zero):
var path = PointB - PointA;
Vector3 left = Vector3.Cross(path, Vector3.up).normalized * radius;
var assemblyPoint = new Vector3(left.x, 0, left.z).normalized * radius;
This offers a degree which is shut, however not fairly proper. The answer can use both 2D or 3D strategies.
[ad_2]