# Help me find a fitting equation

• Jan 5th 2010, 07:19 AM
Myx
Help me find a fitting equation
Hello there!

I'll just cut straight to the problem.
I need a function f(X, Y) which takes two inputs ranging from -1 to 1.
X and Y describes a circle.
The function should give the following results:

f( 0.0, -1.0) = 0
f( 0.5, -0.5) = 0.25
f( 1.0, 0.0) = 0.5
f( 0.5, 0.5) = 0.75
f( 0.0, 1.0) = 1
f(-0.5, 0.5) = 1.25
f(-1.0, 0.0) = 1.5
f(-0.5, -0.5) = 1.75

Any and all help is appreciated.
(I apologize if I've posted in the wrong forum)

// Myx
• Jan 5th 2010, 08:10 AM
earboth
Quote:

Originally Posted by Myx
Hello there!

I'll just cut straight to the problem.
I need a function f(X, Y) which takes two inputs ranging from -1 to 1.
X and Y describes a circle.
The function should give the following results:

f( 0.0, -1.0) = 0
f( 0.5, -0.5) = 0.25
f( 1.0, 0.0) = 0.5
f( 0.5, 0.5) = 0.75
f( 0.0, 1.0) = 1
f(-0.5, 0.5) = 1.25
f(-1.0, 0.0) = 1.5
f(-0.5, -0.5) = 1.75

Any and all help is appreciated.
(I apologize if I've posted in the wrong forum)

// Myx

I've made a sketch from the given points. It seems to me that these points belong to a helix:

$\displaystyle \left|\begin{array}{l}x=\cos\left(t-\frac \pi2\right) \\ y=\sin\left(t-\frac \pi2\right) \\ z=\frac1\pi t\end{array}\right.$

EDIT: I've attached the sketch. As you can see there are some points which doesn't fit into the parametric equation I gave you. So you have to modify probably the equation a little bit :D
• Jan 5th 2010, 01:40 PM
Myx
Ah, that did the trick. Thank you!