Module vecmath

Class Line

java.lang.Object
de.grogra.vecmath.geom.Line

public class Line extends Object
This class represents the geometry of a line.
Author:
Ole Kniemeyer
  • Field Details

    • origin

      public Tuple3d origin
      Origin of the line.
    • direction

      public Vector3d direction
      Specifies the direction of the line. This vector is not necessarily normalized.
    • start

      public double start
      The line starts at origin + start * direction.
    • end

      public double end
      The line ends at origin + end * direction. The condition start <= end has to be satisfied.
    • directionDensity

      public float directionDensity
      The probability density of direction for this ray. This field is set by Shader.generateRandomRays and Light.generateRandomRays. If pω+ is the probability density that has been used for generating the random ray direction (measured with respect to projected solid angle ω+, i.e., dω+ = cos θ dω), then this field is set to pω+(direction). It is not defined for rays emanating from a directional light source. It may be Float.POSITIVE_INFINITY as a result of Shader.generateRandomRays, namely for ideal specular reflection or transmission.
    • originDensity

      public float originDensity
      The probability density of origin for this ray. This field is set by Light.generateRandomRays. If px is the probability density that has been used for generating the random ray origin, then this field is set to px(origin). It is not defined for rays emanating from a point light source.
    • spectrum

      public Color3f spectrum
      The spectrum of the ray. Depending on context, this may represent the ray's spectral radiant power or other properties.
    • reflected

      public boolean reflected
    • x

      public float x
    • y

      public float y
    • valid

      public boolean valid
  • Constructor Details

    • Line

      public Line()
    • Line

      public Line(Tuple3d origin, Vector3d direction, double start, double end)
  • Method Details

    • setLineAttributes

      public void setLineAttributes(double start, double end)
    • lengthSquared

      public double lengthSquared()
      Returns the square of the length of this line.
      Returns:
      squared length of this line
    • length

      public double length()
      Returns the length of this line.
      Returns:
      length of this line
    • distanceSquared

      public double distanceSquared(Tuple3d point)
      Computes the square of the distance between point and this line. The distance is defined to be the distance between point and the closest point of this line.
      Parameters:
      point - a point
      Returns:
      squared distance to point
    • distance

      public double distance(Tuple3d point)
      Computes the distance between point and this line. The distance is defined to be the distance between point and the closest point of this line.
      Parameters:
      point - a point
      Returns:
      distance to point
    • deepCopy

      public Line deepCopy()
    • toString

      public String toString()
      Overrides:
      toString in class Object