Class Torus

java.lang.Object
org.episteme.core.mathematics.geometry.surfaces.Torus
All Implemented Interfaces:
Function<Vector<Real>, Vector<Real>>, ContinuousFunction<Vector<Real>, Vector<Real>>, DifferentiableFunction<Vector<Real>, Vector<Real>>, Function<Vector<Real>, Vector<Real>>, Relation<Vector<Real>, Vector<Real>>, ParametricSurface

public class Torus extends Object implements ParametricSurface
Represents a torus as a parametric surface.

A torus is generated by revolving a circle around an axis. Parametrization: S(u,v) = ((R+r*cos(v))*cos(u), (R+r*cos(v))*sin(u), r*sin(v)) where: - R is the major radius (distance from center to tube center) - r is the minor radius (tube radius) - u ∈ [0,2π] is the angle around the major circle - v ∈ [0,2π] is the angle around the minor circle

Since:
1.0
Author:
Silvere Martin-Michiellot, Gemini AI (Google DeepMind)
  • Constructor Details

    • Torus

      public Torus(PointND center, Real majorRadius, Real minorRadius)
      Creates a torus.
      Parameters:
      center - the center point (must be 3D)
      majorRadius - the major radius (R)
      minorRadius - the minor radius (r)
  • Method Details

    • at

      public PointND at(Real u, Real v)
      Description copied from interface: ParametricSurface
      Evaluates the surface at parameters (u, v).
      Specified by:
      at in interface ParametricSurface
      Parameters:
      u - the first parameter
      v - the second parameter
      Returns:
      the point on the surface
    • partialU

      public Vector<Real> partialU(Real u, Real v, Real h)
      Description copied from interface: ParametricSurface
      Returns the partial derivative ∂S/∂u.

      This is the tangent vector in the u-direction.

      Specified by:
      partialU in interface ParametricSurface
      Parameters:
      u - the first parameter
      v - the second parameter
      h - the step size for numerical differentiation
      Returns:
      the partial derivative vector
    • partialV

      public Vector<Real> partialV(Real u, Real v, Real h)
      Description copied from interface: ParametricSurface
      Returns the partial derivative ∂S/∂v.

      This is the tangent vector in the v-direction.

      Specified by:
      partialV in interface ParametricSurface
      Parameters:
      u - the first parameter
      v - the second parameter
      h - the step size for numerical differentiation
      Returns:
      the partial derivative vector
    • gaussianCurvature

      public Real gaussianCurvature(Real u, Real v, Real h)
      Description copied from interface: ParametricSurface
      Returns the Gaussian curvature at (u, v).

      K = (LN - M²) / (EG - F²) where L, M, N are second fundamental form coefficients and E, F, G are first fundamental form coefficients.

      Specified by:
      gaussianCurvature in interface ParametricSurface
      Parameters:
      u - the first parameter
      v - the second parameter
      h - the step size
      Returns:
      the Gaussian curvature
    • surfaceArea

      public Real surfaceArea()
      Returns the surface area of the torus.
      Returns:
      4π²Rr
    • volume

      public Real volume()
      Returns the volume enclosed by the torus.
      Returns:
      2π²Rr²
    • getCenter

      public PointND getCenter()
      Returns the center of the torus.
      Returns:
      the center point
    • getMajorRadius

      public Real getMajorRadius()
      Returns the major radius.
      Returns:
      the major radius (R)
    • getMinorRadius

      public Real getMinorRadius()
      Returns the minor radius.
      Returns:
      the minor radius (r)
    • toString

      public String toString()
      Overrides:
      toString in class Object