Interface EuclideanSpace<V>

All Superinterfaces:
AffineSpace<V>

public interface EuclideanSpace<V> extends AffineSpace<V>
Represents a Euclidean space.

A Euclidean space is an affine space equipped with a metric (distance function) and an inner product. This allows measurement of distances, angles, and norms.

Key properties: - All affine space operations - Distance measurement between points - Norm (length) of vectors - Inner product (dot product)

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

    Modifier and Type
    Method
    Description
    default Real
    angle(V u, V v)
    Computes the angle between two vectors.
    default boolean
    areOrthogonal(V u, V v)
    Checks if two vectors are orthogonal (perpendicular).
    default Real
    distance(V a, V b)
    Computes the distance between two points.
    innerProduct(V u, V v)
    Computes the inner product (dot product) of two vectors.
    Returns the metric for this Euclidean space.
    norm(V vector)
    Computes the norm (length) of a vector.

    Methods inherited from interface AffineSpace

    barycenter, difference, interpolate, translate
  • Method Details

    • metric

      Metric<V> metric()
      Returns the metric for this Euclidean space.

      The metric defines the distance function d(x,y).

      Returns:
      the metric
    • distance

      default Real distance(V a, V b)
      Computes the distance between two points.

      This is a convenience method that delegates to the metric.

      Parameters:
      a - the first point
      b - the second point
      Returns:
      the distance between a and b
    • norm

      Real norm(V vector)
      Computes the norm (length) of a vector.

      For Euclidean spaces, this is the L2 norm: √(x₁² + x₂² + ... + xₙ²)

      Parameters:
      vector - the vector
      Returns:
      the norm of the vector
    • innerProduct

      Real innerProduct(V u, V v)
      Computes the inner product (dot product) of two vectors.

      For Euclidean spaces: ⟨u,v⟩ = u₁v₁ + u₂v₂ + ... + uₙvₙ

      Parameters:
      u - the first vector
      v - the second vector
      Returns:
      the inner product
    • angle

      default Real angle(V u, V v)
      Computes the angle between two vectors.

      Returns the angle in radians, in the range [0, π]. Uses the formula: cos(θ) = ⟨u,v⟩ / (‖u‖ ‖v‖)

      Parameters:
      u - the first vector
      v - the second vector
      Returns:
      the angle in radians
    • areOrthogonal

      default boolean areOrthogonal(V u, V v)
      Checks if two vectors are orthogonal (perpendicular).

      Vectors are orthogonal if their inner product is zero.

      Parameters:
      u - the first vector
      v - the second vector
      Returns:
      true if orthogonal