another help in a simple math equation

Started by
6 comments, last by winsrp 11 years, 10 months ago
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
Advertisement
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 plug it in to Wolfram|Alpha and you'll get y = sqrt(2x - x[sup]2[/sup]) (which is what I got, but further simplified).
[size=2][ I was ninja'd 71 times before I stopped counting a long time ago ] [ f.k.a. MikeTacular ] [ My Blog ] [ SWFer: Gaplessly looped MP3s in your Flash games ]
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

I'm sorry about any spelling or grammar mistakes or any undue brevity, as I'm most likely typing on my phone

"Hell, there's more evidence that we are just living in a frequency wave that flows in harmonic balance creating the universe and all its existence." ~ GDchat

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.

happy.png

thks
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..
This is what I'm doing with the equations

[sharedmedia=core:attachments:9460]

hmm I don't know if its excel graphs or something, becuase that equation still looks like an ugly oval.

Well, if you plug it in to Wolfram|Alpha, 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.


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.

That's cool. I'm just curious smile.png
[size=2][ I was ninja'd 71 times before I stopped counting a long time ago ] [ f.k.a. MikeTacular ] [ My Blog ] [ SWFer: Gaplessly looped MP3s in your Flash games ]
crap, its excel cheating on me...

Google agrees with you

http://lmgtfy.com/?q=sqrt(1-(x-1)%5E2)

This topic is closed to new replies.

Advertisement