Add riemman surfaces family
This commit is contained in:
@@ -1,3 +1,4 @@
|
|||||||
|
#include <complex.h>
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|
||||||
@@ -9,6 +10,25 @@
|
|||||||
#define M_PI 3.14159265358979323846
|
#define M_PI 3.14159265358979323846
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifndef CMPLX
|
||||||
|
#define CMPLX(a,b) (a+I*b)
|
||||||
|
#endif
|
||||||
|
|
||||||
|
void riemman(float *d_surface, int * coords, int grid_size)
|
||||||
|
{
|
||||||
|
complex double eq;
|
||||||
|
float u = 2 * ((float)coords[0] / grid_size) - 1;
|
||||||
|
float v = 2 * ((float)coords[1] / grid_size) - 1;
|
||||||
|
|
||||||
|
eq = csqrt(CMPLX(u,v));
|
||||||
|
|
||||||
|
d_surface[0] = u;
|
||||||
|
d_surface[1] = v;
|
||||||
|
d_surface[2] = creal(eq);
|
||||||
|
d_surface[3] = cimag(eq);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void mobius(float *d_surface, int * coord, int grid_size)
|
void mobius(float *d_surface, int * coord, int grid_size)
|
||||||
{
|
{
|
||||||
const float width = 0.5;
|
const float width = 0.5;
|
||||||
|
|||||||
Reference in New Issue
Block a user