elliptic trigonometry problem

Hello,

please consider this figure

http://www.mordan.biz/images/elliptic_trigo.jpg

b is known
a is known
a’ is known

find b’ and alpha

I have been banging my head for one hour and can’t find it. need to give it some rest.

knowing a’, I need to find the point M’s y coordinate.

I have been looking at this pdf but that was too much for me

http://www.wseas.us/e-library/transactions/mathematics/2009/32-411.pdf

The equation for an ellipse is
x2/a2 + y2/b2 = 1

So lets assume in this case a’ = x and b’ = y
in this case

I believe the answer would be
y = sqrt( (1-x2/a2)*b2 )

I believe the calculation for the angle would then be arctan(y/x) = arctan(b’/a’)


also sometimes look for simple location, instead of advanced math articles :slight_smile:


i’m surprised there is no cosine in the formula.

but that’s great.

thx man :slight_smile:

for alpha it sure is easy once you know a’ and b’.

got another problem

consider again the figure above

this time

b’ is known (V2)
a-a’ is know (V1)

The trick is that a is not know, nor is a’! We only know the distance between them.

Find a and b :slight_smile:

I’m not sure there is a single solution. I guess there will be a formula of b against a.

From the equation x2/a2 + y2/b2 = 1

I have (a-V1)2/a2 + V22/b2=1

if k = (a-V1)2/a2

b = V2 / sqrt( 1-k )

So here I have formula of b against a but when I draw it on screen it doesn’t work.

The idea is knowing M point and its opposite N, draw an elliptic Arc through those 2 points and point a. but center of ellipse is not know.

when you say
a-a’ do you mean a and a’ are known or only distance between them?

edit:
Unknowns: b and a, a’, alpha angle
Knowns: b’ the distance between a and a’

I will look around and see what I can find, but that might be too many unknowns.
For each unknown, you need another equation.

editv2:
just curious, what exactly is this for or how is it going to be implemented in a game? it can be really sketchy/rough. I am just curious. As this is quite a few number of unknowns.

hey thx for asking. I still haven’t managed to do that one.

It is for drawing shapes of leaves. A simply ellipse does not look like a leaf.

So let’s say I want a leaf with 10 pixels on the left, 15 pixels on the right (for a total of 25 pixels in width). Leaf is say 100 pixel in length/height.

I decided to model half a leaf as an ellipse cut by a vertical line.

This is what I do for drawing half a leaf

I know the top point of the leaf. topX,topY (can be modeled as point M in figure)
I know the bottom pointer of the leaf, botX,botY

In my case topX=botX. I will do rotations later if needed.

I know that the distance between a and a’ in the above image is 10 pixels for the left part.

Once I know a and b of the ellipse, I draw the ellipse correctly offsetted and clipping on the area of half the leaf, it draws the left half of the leave.

It does not matter if there is an unknown. This unknown can be made a parameter for the leaf creation and put into the equation.

I just need this ellipse equation that goes through

(topX,topY) (topX, botY) (vertical line) and (topX + 10, MiddlePointer Between TopY and BotY). This last point is the (Distance(a,a’) in the model)

that’s for one part. the other part is similar except the other way around.

all I managed to do is draw half a real ellipse and not a truncated one. so maybe I don’t model the problem correctly.

thx for your time.

yeah, I can understand now. I am sorry I couldn’t be more help though. It started to get out of my ability.

Don’t give up though, just keep at it, try different solutions though. I am sure you’ll find one that works

edit: although I am sure its not what you originally wanted to do. But one possible solution would be to manually draw or enter in solid numbers for a curved polygon or curved line of some sort. Then just simply make an equation that scales/morphs that line for random/different leaves. At different points along a curved line.

It could also be made to scale/vary the entire size of the leaf and pattern while still holding true to a certain “leaf” look

If you’re interested in procedurally generating leaf shapes, you might find http://algorithmicbotany.org/papers/ interesting.