Add riemman surfaces family

This commit is contained in:
PedroEdiaz
2024-11-21 18:56:05 -06:00
parent 8811c4e0b7
commit e4a4a8c603

View File

@@ -1,3 +1,4 @@
#include <complex.h>
#include <math.h>
#include <stdlib.h>
@@ -9,6 +10,25 @@
#define M_PI 3.14159265358979323846
#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)
{
const float width = 0.5;