# another help in a simple math equation

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

## 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 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 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). Edited by Cornstalks

##### 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 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.

thks Edited by winsrp

##### 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 on other sites
This is what I'm doing with the equations

[sharedmedia=core:attachments:9460]

##### Share on other sites

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 Edited by Cornstalks

1. 1
Rutin
24
2. 2
3. 3
JoeJ
18
4. 4
5. 5

• 13
• 38
• 23
• 13
• 13
• ### Forum Statistics

• Total Topics
631714
• Total Posts
3001861
×

## Important Information

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!