What's the formula for the given code? Calabi Yau manifolds

80 Views Asked by At

I need help finding a reference online for the formula that I tried to implement a few years ago and can't find the link anymore.

Here's the code. MyFunction return the position of each sphere at any given moment (float t), given their coordinates in the array (float u, float v) shown in the preview youtube link below.

static Vector3 MyFunction(float u, float v, float t)
{
    Vector3 p;
    float alpha = (u + v) * GraphComponent.resolution;
    
    p = Coordinate(u, v, t,
        u * GraphComponent.resolution * GraphComponent.value1,
        v * GraphComponent.resolution * GraphComponent.value2,
        alpha * GraphComponent.value3);
    return p;
}

static Vector3 Coordinate(float x, float y, float n, float k1, float k2, float a)
{
    float twoByN = 2 / n;
    Complex32 z1 = Multiply(
        Exp(new Complex32(0, 2f * math.PI * k1 / n)),
        Pow(Complex32.Sin(new Complex32(x, y)), twoByN)
    );
    Complex32 z2 = Multiply(
        Exp(new Complex32(0, 2f * math.PI * k2 / n)),
        Pow(Sin(new Complex32(x, y)), twoByN)
    );
    return new Vector3(z1.Real, z2.Real, z1.Imaginary * math.cos(a) + z2.Imaginary * math.sin(a));
}

Here's the preview of the function in action https://youtu.be/P9H5AE1ygH0

This was supposed to implement a space that would include calabi yau manifolds. My maths experience is too basic for this complexity of a task, but as a coder I wanted to challenge myself, so I tried my best to approximate the implementation to a formula I saw online years ago. However, my worst mistake I lost the link to it and now I can't find the original formula I used as reference.

Ps. I know, I should have added the formula as a link in the comment of the code, which I normally do, forgot to do it this time.