1

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.

user506901
  • 699
  • 4
  • 9
  • 18

2 Answers2

1

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.

Vlad
  • 35,022
  • 6
  • 77
  • 199
  • Thanks. Is there an 'automatic' formula for calculating the arc length given arc endpoints (one that does incorporate the angles)? That formula should involve the original arc endopoints (not the results of transformation) – user506901 Nov 14 '10 at 13:53
  • @user: well, the arc length equals to the angle in radians multiplied by radius – Vlad Nov 14 '10 at 13:57
  • Thanks. Assume that I determined the 'side' of the point K relative to the line AB (this is determined by a posive sign, say, of the approach suggested on 'Determine which side of a line a point lies'). Also, I've found the equation of the tangent line. Now, I want to obtain new point Kt on the tangent line t that is from the same side of the line AB as K, but Kt should be on the tangent t. Say the distance AKt should be p. How to proceed with the placement of Kt at the correct side? Thanks – user506901 Nov 15 '10 at 11:51
  • @user: this is one of the problem which would be completely avoided if taken my approach. Well, if you would like to go your way anyway, you need to do the following: 1. Consider the point `C` where the angle `AOC` is 90. The vector `OC` is surely a [direction vector](http://en.wikipedia.org/wiki/Direction_vector) of your tangent. Moreover, its length equals to the circle's radius. – Vlad Nov 15 '10 at 12:26
  • 2. For every other point `a`, calculate the angle `alpha` = `aOA` in radians. The vector `alpha` * `OC` will be directed along the line, will have the needed length and will look in the correct direction. 3. Your point `at` is now `A` + `alpha` * `OC`. – Vlad Nov 15 '10 at 12:26
0

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.

Community
  • 1
  • 1
Oliver Charlesworth
  • 267,707
  • 33
  • 569
  • 680
  • Thanks.I would need to know if the following are correct (and what is the reasoning behind): – user506901 Nov 13 '10 at 19:00
  • Thanks. Assume that I determined the 'side' of the point K relative to the line AB (this is determined by a posive sign, say, of the approach suggested on 'Determine which side of a line a point lies'). Also, I've found the equation of the tangent line. Now, I want to obtain new point Kt on the tangent line t that is from the same side of the line AB as K, but Kt should be on the tangent t. Say the distance AKt should be p. How to proceed with the placement of Kt at the correct side? Thanks – user506901 Nov 15 '10 at 11:47