We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
Page Index Toggle Pages: 1
Math-Formula (Read 864 times)
Math-Formula
Mar 10th, 2010, 2:22pm
 


Hello Guys,

I just took a look at

http://demonstrations.wolfram.com/NordstrandsWeirdSurface/

Can anyone translate the given Formula on

http://mathworld.wolfram.com/NordstrandsWeirdSurface.html

to a decent
x=
y=
and
z=

thing

Cheers.

Chrisir      Wink




Re: Math-Formula
Reply #1 - Mar 12th, 2010, 3:53am
 
I don't believe the shapes you want to draw can simply be reduced to 3 independant formulae for x, y and z..

For instance
x2 + y2 + z2 -r2 = 0

represents the surface of a sphere of radius r

It can be used to prove/disprove that a given x/y/z coordinate is on the surface BUT would not be used to calculate coordinates for drawing a sphere.

I might be mistaken in my belief and I would be pleased if someone could prove me wrong as it would be fun to create such images.


The actual images were created with specialist maths software i.e. Mathematica
Re: Math-Formula
Reply #2 - Mar 12th, 2010, 8:33am
 

Quote:
I might be mistaken in my belief and I would be pleased if someone could prove me wrong as it would be fun to create such images.



Hello,

I am not into math...

but maybe I can prove you wrong...

I did a 3D graph plotter, and in the last function
I used something similar from
http://local.wasp.uwa.edu.au/~pbourke/geometry/cresent/
- see code snippet below.
The full thing is found under
http://www.openprocessing.org/visuals/?visualID=7098

But it doesn't run in my browser, you would have to download.

Cheers!   Wink

Greetings, Chris




void InitGraph_Cresent() {

 // see http://local.wasp.uwa.edu.au/~pbourke/geometry/cresent/

 //x = (2 + sin(2 pi u) sin(2 pi v)) sin(3 pi v)  
 //y = (2 + sin(2 pi u) sin(2 pi v)) cos(3 pi v)  
 //
 //z = cos(2 pi u) sin(2 pi v) + 4 v - 2  
 //
 //with 0 <= u <= 1, 0 <= v <= 1  

 float r1 = 100 ;  
 float u= 0;
 float x1,y1,z1;
 int indexI=0;  
 int indexJ = 0;

 for (int i = 0; i < 101; i = i+1) {
   float v=0;
   indexJ = 0;  
   for (int j = 0; j < 101; j = j+1) {

     x1 = (2 + sin(2 *PI *u) * sin(2 *PI *v)) *sin(3 *PI *v) ;
     y1 = (2 + sin(2 *PI *u) * sin(2 *PI *v)) *cos(3 *PI *v);  
     z1 = cos(2 *PI *u) *sin(2 *PI *v) + 4 *v - 2 ;

     MyResults[indexI][indexJ] = new PVector(100*x1,100*y1,100*z1);

     v = v + 0.03; // .01
     indexJ=indexJ+1;  
   }
   u = u + 0.03; // .01  
   indexI=indexI+1;  
 }
 MaxindexJ = indexJ - 1;  
 MaxindexI = indexI - 1;  
}
Page Index Toggle Pages: 1