Class GoldenRatio

java.lang.Object
org.episteme.social.arts.GoldenRatio

public final class GoldenRatio extends Object
Provides mathematical tools for analyzing compositional proportions, specifically focusing on the Golden Ratio (phi) and the Fibonacci sequence. These metrics are frequently used in art history and architectural analysis to evaluate the aesthetic structure of works.
Since:
1.0
Version:
2.0
Author:
Silvere Martin-Michiellot, Gemini AI (Google DeepMind)
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final Real
    The Golden Ratio (phi) = (1 + sqrt(5)) / 2 approx 1.6180339887...
    static final Real
    The inverse of the Golden Ratio (1/phi) approx 0.6180339887...
  • Method Summary

    Modifier and Type
    Method
    Description
    static Real
    analyzeProportions(List<Real> measurements, Real tolerance)
    Scans a set of measurements and calculates what fraction of measurement pairs conform to the Golden Ratio.
    static List<Long>
    fibonacci(int n)
    Generates a Fibonacci sequence up to specified number of terms.
    static Real
    fibonacciN(int n)
    Calculates the n-th Fibonacci number using Binet's formula for direct analytical computation.
    static Real[]
    Calculates the dimensions of a Golden Rectangle derived from a base width.
    static Real[]
    goldenSection(Real totalLength)
    Divides a total length into two segments according to the Golden Ratio.
    static List<Real>
    goldenSpiralRadii(Real initialRadius, int quarterTurns)
    Generates the radii of a Golden Spiral for a given number of quarter-turns.
    static boolean
    isGoldenRatio(Real larger, Real smaller, Real tolerance)
    Checks if the ratio of two measurements approximates the Golden Ratio within a specified tolerance.

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • PHI

      public static final Real PHI
      The Golden Ratio (phi) = (1 + sqrt(5)) / 2 approx 1.6180339887...
    • PHI_INVERSE

      public static final Real PHI_INVERSE
      The inverse of the Golden Ratio (1/phi) approx 0.6180339887...
  • Method Details

    • fibonacci

      public static List<Long> fibonacci(int n)
      Generates a Fibonacci sequence up to specified number of terms.
      Parameters:
      n - the number of terms to generate
      Returns:
      the Fibonacci sequence
    • fibonacciN

      public static Real fibonacciN(int n)
      Calculates the n-th Fibonacci number using Binet's formula for direct analytical computation.
      Parameters:
      n - the position in the sequence
      Returns:
      the n-th Fibonacci number as a Real
    • isGoldenRatio

      public static boolean isGoldenRatio(Real larger, Real smaller, Real tolerance)
      Checks if the ratio of two measurements approximates the Golden Ratio within a specified tolerance.
      Parameters:
      larger - the larger measurement
      smaller - the smaller measurement
      tolerance - the maximum allowed deviation from phi
      Returns:
      true if the ratio matches the Golden Ratio
    • goldenSection

      public static Real[] goldenSection(Real totalLength)
      Divides a total length into two segments according to the Golden Ratio.
      Parameters:
      totalLength - the total length to divide
      Returns:
      an array containing [largerSegment, smallerSegment]
    • goldenSpiralRadii

      public static List<Real> goldenSpiralRadii(Real initialRadius, int quarterTurns)
      Generates the radii of a Golden Spiral for a given number of quarter-turns.
      Parameters:
      initialRadius - the starting radius
      quarterTurns - number of 90-degree turns to compute
      Returns:
      list of radii for each turn
    • goldenRectangle

      public static Real[] goldenRectangle(Real width)
      Calculates the dimensions of a Golden Rectangle derived from a base width.
      Parameters:
      width - the base width
      Returns:
      array containing [width, height] where width/height = phi
    • analyzeProportions

      public static Real analyzeProportions(List<Real> measurements, Real tolerance)
      Scans a set of measurements and calculates what fraction of measurement pairs conform to the Golden Ratio.
      Parameters:
      measurements - list of measured dimensions in an artwork
      tolerance - maximum allowed error
      Returns:
      a percentage (0 to 1) of pairs matching the golden proportion