Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Geometry problem 2

Status
Not open for further replies.

bodhi

Programmer
Jan 3, 2002
67
GB
I am provided with two endpoints and the tangent to an endpoint (or both endpoints as the curve must be uniform). I need to draw a uniform curve (section of a perfect circle)from one endpoint to the other as a 4 node bezier curve (two anchors being the two endpoints and two handles determining the curve).

I'm struggling to determine the 'depth' of the curve (and hence the position of the two handle points). Does anyone know how to get this from the information I have ?

I seem to remember when I got into this sort of thing a couple of years ago that there was a comp.geom. faq website which was a godsend for these types of problems but can't find it now..
If anyone has links to this type of resource I'd appreciate it..

Thx.
 
To narrow down the problem :

I have a circle in which I know the endpoints of a chord in the circle and the angle between the tangent to an endpoint and the chord.

I require the radius of the circle.

thx.
 
This might be wrong because it's the product of 30 seconds thought, but if you draw perpendiculars to the tangents at the two endpoints, they will cross at the centre of the circle, forming an isoceles triangle with the chord. You know the length of the base of the triangle (distance between the two endpoints, pythagoras). The internal angles are 90-tangent-to-chord angle (which is of course the same on both end-points), and the angle at the middle of the circle is twice the tangent-to-chord angle.
The easiest thing now is to draw a perpendicular through the middle of the chord, to the centre of the circle, to give you two rightangle triangles, where you know the angle in the corner and the length of one of the sides (half chord length). The radius is the other side.
So radius equals half chord length divided by sine of tangent-to-chord angle, I think...???

 
Hi, LionelHill is right and here I will structure the problem and the resolution:

Let be AB the chord, e.g A and B are on the circle with O center and &#945;. the angle of the chord with the tangent in A ( &#945; <= 90 ).
Construction:
Draw the tangent in A to the circle and choose an arbitrary point T on this such as B&#256;T = &#945;.
Draw OA and OB.
Draw OM perpendicular to AB.
Resolution1:
Triangle AÔB is isosceles because OA=OB as radius.
OM perpendicular on AB => AM=MB=AB/2
OA is perpendicular on the AT because AT is tangent in A.
Now the M&#256;O (angle in A) is a equal to O&#256;T – &#945; = 90 - &#945;.
Applying cos in the AMO triangle :
Cos(O&#256;T) = AM/OA => Cos(90- &#945;) = ½ * AB/OA =>
Sin &#945; = AB/2*OA =>
OA = AB/ 2*sin &#945;;

Resolution 2:
AÔM is equal to B&#256;T as angles with perpendicular sides.
Sin AÔM = AM/OA=AB/2*OA => sin &#945; = AB/2*OA => OA = AB/2*sin &#945;

-obislavu-
 
Thanks a lot guys :)

From this I can get the distance along the tangent line to place the bezier handle.

What I'm unsure about is how best to calculate the co-ordinate points of the handle.

I have two lines (chord and tangent), know the length of both lines, the angle between them and two of the three co-ordinate points (namely those at each end of the chord).

I want to get the third co-ordinate point (at the end of the tangent line).

Have tried to slog this out by dropping perpendiculars and working with R.A.T.'s but, given that the angle is arbitrary I've quickly found myself writing switch cases for different angle ranges which seems messy.

Any suggestions?

Thx again.



 
What I understood :
AB is a chord defined by A(a1,a2), B(b1,b2) , AT is tangent in A at circle where AB is chord. AT =d and also the B&#256;T is known , let be it equal to &#945;.
Find out the coordinates of the T point.
There are many solutions but here is one:
Let be T(u,v) .
First equation: (u-a1)**2 + (v-a2)**2 = d**2 (1)
Second equation:
The &#945; angle is the angle between the AB and AT lines. Let be &#947;1 the angle made by AB with OX and &#947;2 the angle made by AT with OX. Then &#947;2 = &#947;1 – &#945; => &#945; = &#947;2 – &#947;1.
Applying tan function we obtain the second realtion :
tan &#945; = (tan (&#947;2 – &#947;1) = (tan &#947;2 - tan &#947;1 )/ (1 +
tan &#947;1 * tan &#947;2) (2)
Or the angle made by AB with OX is :
tan &#947;1 = (b2-b1)/(a2-a1)
The angle made by AT with OX is :
tan &#947;2 = (v-a2)/(u-a1)
Finally , the second equation will be from (2):

tan &#945; = [(v-a2)/(u-a1) –(b2-b1)/(a2-a1)]/( 1+ (b2-b1)(v-a2)/(a2-a1)(u-a1)) (3)

Now (1) and (3) gives you a two equation system which is easy to resolve:
From (3) you extract u for example, replace it in (1) and you obtain solution for v which in turn allows to determine the value of u, so T(u,v).

-obislavu-

 
Thats exactly what I needed (once again).

Many thanks :)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top