I have a line from the center point of a circle to another point. I want to find the point where the line intersects the
By : Matt K.
Date : March 29 2020, 07:55 AM
To fix this issue It's easier to treat this as a vector problem. Your second approach is close, but you don't correctly scale the vector between the two points. It's easier to work with a normalized vector in this case, although you have to assume that the distance between the two points on the line is nonzero. Given: code :
double x0 = CIRC_X0; /* xcoord of center of circle */
double y0 = CIRC_Y0; /* ycoord of center of circle */
double x1 = LINE_X1; /* xcoord of other point on the line */
double y1 = LINE_Y1; /* ycoord of other point on the line */
double vx = x1  x0;
double vy = y1  y0;
double vmag = sqrt(vx*vx + vy*vy);
vx /= vmag; /* Assumption is vmag > 0 */
vy /= vmag;
x0 + dist * vx
y0 + dist * vy
double x_intersect = x0 + CIRC_RADIUS * vx;
double y_intersect = y0 + CIRC_RADIUS * vy;

Find the point on a circle with given center point, radius, and degree
By : Gustsaiyonee
Date : March 29 2020, 07:55 AM
To fix this issue The simple equations from your link give the X and Y coordinates of the point on the circle relative to the center of the circle. code :
X = r * cosine(angle)
Y = r * sine(angle)
X = Cx + (r * cosine(angle))
Y = Cy + (r * sine(angle))

Find a specific point on a circle by a point & angle between them
By : Dixit
Date : March 29 2020, 07:55 AM
around this issue Basic trigonometry or application of a rotation matrix (not to forget: translate the center to the origin and after rotation back to its inital position): code :
XM=a+cos(C°)*(X1a)sin(C°)*(Y1b)
YM=b+sin(C°)*(X1a)+cos(C°)*(Y1b)
XM=a+cos(C°)*(X1a)sin(C°)*(bY1)
YM=bsin(C°)*(X1a)cos(C°)*(bY1)
XM=a+cos(C°)*(X1a)+sin(C°)*(Y1b)
YM=bsin(C°)*(X1a)+cos(C°)*(Y1b)
XM=a+cos(C°)*(X1a)sin(C°)*(Y1b)
YM=b+sin(C°)*(X1a)+cos(C°)*(Y1b)

Find 3d coordinates of a point on a line projected from another point in 3d space
By : seovalencia
Date : March 29 2020, 07:55 AM
I wish did fix the issue. Working in Swift, ARTKit / SceneKit , Parameterize the line AB with a scalar t: code :
P(t) = A + (B  A) * t`
dot(C  D, B  A) = 0
dot(C  A  (B  A) * t, B  A) = 0
dot(C  A, B  A) = t * dot(B  A, B  A)
// Substitute value of t
> D = A + (B  A) * dot(C  A, B  A) / dot(B  A, B  A)
var BmA = B  A
var CmA = C  A
var t = dot(CmA, BmA) / dot(BmA, BmA)
var D = A + BmA * t;

Given a circle with N defined points and a point M outside the circle, find the point that is closest to M among the set
By : Remark
Date : March 29 2020, 07:55 AM
it should still fix some issue Assuming that the points on the circumference of the circle are "inorder" (i.e. sorted by angle about the circle's center) you could use an anglebased binary search, which should achieve the O(log(n)) bounds. Calculate the angle A from the point M to the center of the circle  O(1). Use binary search to find the point I on the circumference with largest angle less than A  O(log(n)). Since circles are convex the closest point to M is either I or I+1. Calculate distance to both and take the minimum  O(1).

