Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

nareshn2003

for curve problem

This topic is 5298 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi I have some shape problem PLEASE first of all see this picutre and zoom please . http://www.geocities.com/nareshn2003/curve.jpg In Figure-1 u can see circle-circle intersection . it''s normal Now let define something first in figuer-2 condition A is circle and it''s length(L) and width(W) is same. So guess for condition-A Length,Width=5 value; and result will be circle. Now in condition-B Let length=7 and width=5 is changing so result will be diffrent in picture . In condition -C let length=9 and width=5 so result is more different in picture . And another thing is that i don''t want shape like oval or ellipse i want shape having sharpness at both end of length. I don''t want directly through the arc.. I want x and y cordinate of surface points of that shape..as like in circel we have x=rcos(theta) ,y=rsin(theta) like that i want x and y cordinates.. I had tried with superellispe algoritham but not worked So anyone can suggest me good algoritham or calculations ? devil20

Share this post


Link to post
Share on other sites
Advertisement
Assumptions (some might be more or less obvious):
- Axis-labeling: in your figure the horizontal is the x-axis with positive going to the right. Vertical is the y-axis with positive going up.
- Origin of your coordinate system is the center of the figure (the point where mirroring on x- or y-axis is a symmetry).
- "Angles" mean the angle between the x-axis and the connection line between the point they are "located" (see below) in and the point (x,y)=f(alpha) you want to calculate unless mentioned otherwise. They increase counter-clockwise.
- You want (x,y) = f(alpha) where the two circles are fixed (fixed centers C1 and C2=-C1 and fixed radi r1=r2 > 0.5*|C1-C2|) and symmetric in the sense that I put into parentheses. alpha-angle is located in the origin.

Possible solution:

1) Use the symmetry of the figure: If (x,y) = f(alpha) => -(x,y)= f(alpha+180°). Thus, we can reduce the problem to (x,y) = f(alpha), -90°<= alpha <= 90°. Let this be the part of the curve that is created by circle 1.

2) Use an additional symmetry operation: (x,y)(alpha) = (x,-y)(-alpha). => 0°<=alpha<=90°. This reduction on the 1st quadrant of the coordinate system makes thinking about the problem much easier but is porbably not nessecary.

3) (x,y) = C1 + (r*cos(theta), r*sin(theta)) where theta-angle is located in the point C1=(Cx,0). Problem: Find theta(alpha).

4) Take a look at the triangle formed by the points C1, O=Origin and P=(x,y)=f(alpha). You know 2 sides (C1->P, C1->O) and the angle at O: 180°-alpha.
At this point I was pretty sure the problem is almost solved but after 20 minutes of trying to figure out theta I gave up and took a look into my handbook of mathematics:

5) This handbook tells me a single definite solution for this problem exists (what a surprise) under certain conditions that apply here. The angle x between P->O and P->C1 is x = arcsin(|Cx|*sin(180°-alpha)/r1). Hope I didn´t mess things up here.

6) Since the sum of angles in a triangle equals 180° => x+(180°-alpha)+theta = 180° => theta = ... (now I´m getting really lazy)

7) Plug theta(alpha) into equation at 3) => f(alpha).

8) Have fun trying to simplify this equation

This is a step-by-step sketch of my solution. Better ones might exist and there certainly would have been a better way to represent it. But I wrote this post parallel to working on a solution so I couldn´t present it in a more elegant form since I didn´t knew where I´d end up. I really didn´t want to rewrite this all so you´ll have to live with this post...

Btw.: If an implicite equation y=y(x) is sufficient for you: That´s much easier since you can use p*q=h² (dunno the english name for that equation but I hope you know which one I mean) with h=y, p=x, q=r-x and the symmetry operation in 1).

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!