Question

Assume you're given a circle with the line AB containing its center O, such that A and B are on the circle (OA=OB=radius). A tangent t is drawn on the point A, and I should calculate the mapping of certain points (a,b,c,d...) of the circle to the points on the tangent (at, bt, ct, dt, ...) such that the distance Aa (the distance along the circle) is the same as the distance Aat (the distance along the tangent) (and the same for the distances Ab, Ac, Ad). But, here, certain constraint should be considered: those points of the circle (among (a, b, c, d)) that are from one side of the circle from A to B should be placed on one side of the tangent (the nearer), and those from the other side of the circle form A to B should be placed on the other side. Basically, the circle should be split at B, and then mapped to the tangent. I hope this explanation is sufficient enough.

It should be noted that I have information about coordinates of A, B, O, a, b, c, d. I supposed to calculate (at, bt, ct, dt). For solving this problem, I have two approaches, but I'm not sure how I could make sure they always work correctly.

1) I calculate the equation of the tangent at point A. Then for each point (a, b, c, d) I calculate the distance from A (along the circle), and use these distances for calculating (at, bt, ct, dt...) along the tangent. What I dont know here is how to calculate the distances from A to (a, b, c, d). The problem is the 'proper side' determination, meaning how should I determine whether the point should be mapped on one side of the tangent or the other. What would be the way to determine this.

2) I calculate the equation of the tangent at point A. Then for each point (a, b, c, d) I calculate the distance from A (along the circle), and use these distances for calculating (at, bt, ct, dt...) along the tangent. To determine the 'proper side' of a given point, I might use the projection of that point to the tangent. But, even with this, how I know 'which side is which'? Perhaps there are much simpler ways to do this.

Any suggestion on how to do this is welcome. In case I was not precise enough, I'll elaborate.

Was it helpful?

Solution

To determine which "side" of the circle you're on, you basically need to determine which side of the line AB you're on. For the answer to that, see e.g. Determine which side of a line a point lies.

OTHER TIPS

A better suggestion would be to calculate a coordinate transformation that would map the circle into a unit circle with the centre at the origin, so that A will have coordinates (1, 0) (and B respectively (-1, 0)). The transformation should be dilation with rotation. Now, the distance on Aa is just the angle aOA measured in radians. So you can easily calculate at, it is (1, atan2(y, x)) where (x, y) are the coordinates of a.

Now, the only thing you need is to return to the original coordinate system, applying the inverse transformation.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top