Sign in to follow this  

another help in a simple math equation

This topic is 2010 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

given x in the range from 0 to 1

how can I know Y, for the values in a quarter for a circle

[attachment=9478:pattern2.png]

where

if x = 0 then Y = 0
if x = 1 then y = 1

I was thinking in something like

SQRT(-(((x-1)^2)-1))

but the values are not cuved to be shaped in a circle, looks more like an ugly oval.

Regards,

Winsrp Edited by winsrp

Share this post


Link to post
Share on other sites
Question: what are you accomplishing with these different functions of yours?

The equation of a circle with radius 1 and a center at (1, 0) is: (x - 1)[sup]2[/sup] + (y - 0)[sup]2[/sup] = 1[sup]2[/sup]

Simplify: y[sup]2[/sup] = 1 - (x - 1)[sup]2[/sup]

And since you want the positive part of y:
y = sqrt(1 - (x - 1)[sup]2[/sup])

Or you can [url="http://www.wolframalpha.com/input/?i=y%5E2+%2B+%28x+-+1%29%5E2+%3D+1"]plug it in to Wolfram|Alpha[/url] and you'll get y = sqrt(2x - x[sup]2[/sup]) (which is what I got, but further simplified). Edited by Cornstalks

Share this post


Link to post
Share on other sites
Close. The equation it looks like you're going for is:
y = sqrt(1 - (x - 1)^2), which evaluates to
y = sqrt(2x - x^2)

Also, may I recommend an Algebra 2 textbook? It will teach you alot of things like basic equation transformation.

Cheers,
CulDeVu

Share this post


Link to post
Share on other sites
hmm I don't know if its excel graphs or something, becuase that equation still looks like an ugly oval.

In order to respond to your first question, the first equation is a terrain modulator, where I have a perlin noise funcion and I wanted to create some sea bottom, then lift up, then some nice shores, and then lift mountains again, and then a flatty mountain top.. looks really nice in the renderer by the way.

this other equation is a 3d fmb perlin gradient where i want to diminish the density value of the 3d effect in a circular way, so that I get a reduced effect as I go up. I first tried something like SQRT(X), but the values do not diminish in a circular approach, so I get lots of floating islands over my landscape.

[img]http://public.gamedev.net//public/style_emoticons/default/happy.png[/img]

thks Edited by winsrp

Share this post


Link to post
Share on other sites
Culdevu, yours is inverted in the wrong way, starts with x=0 y=1, and finishes on x=1 y= 0

cornstalks looks more like what it should be, but in excel both of yours looks like an oval.. Edited by winsrp

Share this post


Link to post
Share on other sites
[quote name='winsrp' timestamp='1339707756' post='4949292']
hmm I don't know if its excel graphs or something, becuase that equation still looks like an ugly oval.
[/quote]
Well, if you [url="http://www.wolframalpha.com/input/?i=y+%3D+sqrt%282x+-+x%5E2%29+from+x+%3D+0+to+x+%3D+1"]plug it in to Wolfram|Alpha[/url], and looking at your graph, your initial reaction is that it's an oval. But if you look closer, you'll see the graphs aren't square. The graphs have been stretched horizontally, so of course they look... not circular. If you make the graph square it'll look like a quarter circle.

[quote name='winsrp' timestamp='1339707756' post='4949292']
In order to respond to your first question, the first equation is a terrain modulator, where I have a perlin noise funcion and I wanted to create some sea bottom, then lift up, then some nice shores, and then lift mountains again, and then a flatty mountain top.. looks really nice in the renderer by the way.
[/quote]
That's cool. I'm just curious [img]http://public.gamedev.net//public/style_emoticons/default/smile.png[/img] Edited by Cornstalks

Share this post


Link to post
Share on other sites
crap, its excel cheating on me...

Google agrees with you

[url="http://lmgtfy.com/?q=sqrt(1-(x-1)%5E2)"]http://lmgtfy.com/?q=sqrt(1-(x-1)%5E2)[/url] Edited by winsrp

Share this post


Link to post
Share on other sites

This topic is 2010 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.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this