java.lang.Object
org.hipparchus.geometry.spherical.twod.Circle
All Implemented Interfaces:
Embedding<Sphere2D,S2Point,Sphere1D,S1Point>, Hyperplane<Sphere2D,S2Point,Circle,SubCircle>

This class represents an oriented great circle on the 2-sphere.

An oriented circle can be defined by a center point. The circle is the set of points that are in the normal plan the center.

Since it is oriented the two spherical caps at its two sides are unambiguously identified as a left cap and a right cap. This can be used to identify the interior and the exterior in a simple way by local properties only when part of a line is used to define part of a spherical polygon boundary.

  • Constructor Details Link icon

    • Circle Link icon

      public Circle(Vector3D pole, double tolerance) throws MathIllegalArgumentException
      Build a great circle from its pole.

      The circle is oriented in the trigonometric direction around pole.

      Parameters:
      pole - circle pole
      tolerance - tolerance below which close sub-arcs are merged together
      Throws:
      MathIllegalArgumentException - if tolerance is smaller than Sphere1D.SMALLEST_TOLERANCE
    • Circle Link icon

      public Circle(S2Point first, S2Point second, double tolerance) throws MathIllegalArgumentException
      Build a great circle from two non-aligned points.

      The circle is oriented from first to second point using the path smaller than π.

      Parameters:
      first - first point contained in the great circle
      second - second point contained in the great circle
      tolerance - tolerance below which close sub-arcs are merged together
      Throws:
      MathIllegalArgumentException - if tolerance is smaller than Sphere1D.SMALLEST_TOLERANCE
    • Circle Link icon

      public Circle(Circle circle)
      Copy constructor.

      The created instance is completely independent from the original instance, it is a deep copy.

      Parameters:
      circle - circle to copy
  • Method Details Link icon

    • copySelf Link icon

      public Circle copySelf()
      Copy the instance.

      The instance created is completely independent of the original one. A deep copy is used, none of the underlying objects are shared (except for immutable objects).

      Specified by:
      copySelf in interface Hyperplane<Sphere2D,S2Point,Circle,SubCircle>
      Returns:
      a new hyperplane, copy of the instance
    • reset Link icon

      public void reset(Vector3D newPole)
      Reset the instance as if built from a pole.

      The circle is oriented in the trigonometric direction around pole.

      Parameters:
      newPole - circle pole
    • revertSelf Link icon

      public void revertSelf()
      Revert the instance.
    • getReverse Link icon

      public Circle getReverse()
      Get the reverse of the instance.

      Get a circle with reversed orientation with respect to the instance. A new object is built, the instance is untouched.

      Returns:
      a new circle, with orientation opposite to the instance orientation
    • project Link icon

      public S2Point project(S2Point point)
      Project a point to the hyperplane.
      Specified by:
      project in interface Hyperplane<Sphere2D,S2Point,Circle,SubCircle>
      Parameters:
      point - point to project
      Returns:
      projected point
    • getTolerance Link icon

      public double getTolerance()
      Get the tolerance below which points are considered to belong to the hyperplane.
      Specified by:
      getTolerance in interface Hyperplane<Sphere2D,S2Point,Circle,SubCircle>
      Returns:
      tolerance below which points are considered to belong to the hyperplane
    • toSubSpace Link icon

      public S1Point toSubSpace(S2Point point)
      Transform a space point into a sub-space point.
      Specified by:
      toSubSpace in interface Embedding<Sphere2D,S2Point,Sphere1D,S1Point>
      Parameters:
      point - n-dimension point of the space
      Returns:
      (n-1)-dimension point of the sub-space corresponding to the specified space point
      See Also:
    • getPhase Link icon

      public double getPhase(Vector3D direction)
      Get the phase angle of a direction.

      The direction may not belong to the circle as the phase is computed for the meridian plane between the circle pole and the direction.

      Parameters:
      direction - direction for which phase is requested
      Returns:
      phase angle of the direction around the circle
      See Also:
    • toSpace Link icon

      public S2Point toSpace(S1Point point)
      Transform a sub-space point into a space point.
      Specified by:
      toSpace in interface Embedding<Sphere2D,S2Point,Sphere1D,S1Point>
      Parameters:
      point - (n-1)-dimension point of the sub-space
      Returns:
      n-dimension point of the space corresponding to the specified sub-space point
      See Also:
    • getPointAt Link icon

      public Vector3D getPointAt(double alpha)
      Get a circle point from its phase around the circle.
      Parameters:
      alpha - phase around the circle
      Returns:
      circle point on the sphere
      See Also:
    • getXAxis Link icon

      public Vector3D getXAxis()
      Get the X axis of the circle.

      This method returns the same value as getPointAt(0.0) but it does not do any computation and always return the same instance.

      Returns:
      an arbitrary x axis on the circle
      See Also:
    • getYAxis Link icon

      public Vector3D getYAxis()
      Get the Y axis of the circle.

      This method returns the same value as getPointAt(MathUtils.SEMI_PI) but it does not do any computation and always return the same instance.

      Returns:
      an arbitrary y axis point on the circle
      See Also:
    • getPole Link icon

      public Vector3D getPole()
      Get the pole of the circle.

      As the circle is a great circle, the pole does not belong to it.

      Returns:
      pole of the circle
      See Also:
    • getInsideArc Link icon

      public Arc getInsideArc(Circle other)
      Get the arc of the instance that lies inside the other circle.
      Parameters:
      other - other circle
      Returns:
      arc of the instance that lies inside the other circle
    • wholeHyperplane Link icon

      public SubCircle wholeHyperplane()
      Build a sub-hyperplane covering the whole hyperplane.
      Specified by:
      wholeHyperplane in interface Hyperplane<Sphere2D,S2Point,Circle,SubCircle>
      Returns:
      a sub-hyperplane covering the whole hyperplane
    • emptyHyperplane Link icon

      public SubCircle emptyHyperplane()
      Build a sub-hyperplane covering nothing.
      Specified by:
      emptyHyperplane in interface Hyperplane<Sphere2D,S2Point,Circle,SubCircle>
      Returns:
      a sub-hyperplane covering nothing
    • wholeSpace Link icon

      public SphericalPolygonsSet wholeSpace()
      Build a region covering the whole space.
      Specified by:
      wholeSpace in interface Hyperplane<Sphere2D,S2Point,Circle,SubCircle>
      Returns:
      a region containing the instance (really a SphericalPolygonsSet instance)
    • getOffset Link icon

      public double getOffset(S2Point point)
      Get the offset (oriented distance) of a point.

      The offset is 0 if the point is on the underlying hyperplane, it is positive if the point is on one particular side of the hyperplane, and it is negative if the point is on the other side, according to the hyperplane natural orientation.

      Specified by:
      getOffset in interface Hyperplane<Sphere2D,S2Point,Circle,SubCircle>
      Parameters:
      point - point to check
      Returns:
      offset of the point
      See Also:
    • getOffset Link icon

      public double getOffset(Vector3D direction)
      Get the offset (oriented distance) of a direction.

      The offset is defined as the angular distance between the circle center and the direction minus the circle radius. It is therefore 0 on the circle, positive for directions outside of the cone delimited by the circle, and negative inside the cone.

      Parameters:
      direction - direction to check
      Returns:
      offset of the direction
      See Also:
    • moveToOffset Link icon

      public S2Point moveToOffset(S2Point point, double offset)
      Move point up to specified offset.

      Motion is orthogonal to the hyperplane

      Specified by:
      moveToOffset in interface Hyperplane<Sphere2D,S2Point,Circle,SubCircle>
      Parameters:
      point - point to move
      offset - desired offset
      Returns:
      moved point at desired offset
    • arbitraryPoint Link icon

      public S2Point arbitraryPoint()
      Get an arbitrary point in the hyperplane.
      Specified by:
      arbitraryPoint in interface Hyperplane<Sphere2D,S2Point,Circle,SubCircle>
      Returns:
      arbirary point in the hyperplane
    • sameOrientationAs Link icon

      public boolean sameOrientationAs(Circle other)
      Check if the instance has the same orientation as another hyperplane.

      This method is expected to be called on parallel hyperplanes. The method should not re-check for parallelism, only for orientation, typically by testing something like the sign of the dot-products of normals.

      Specified by:
      sameOrientationAs in interface Hyperplane<Sphere2D,S2Point,Circle,SubCircle>
      Parameters:
      other - other hyperplane to check against the instance
      Returns:
      true if the instance and the other hyperplane have the same orientation
    • getArc Link icon

      public Arc getArc(S2Point a, S2Point b)
      Get the arc on this circle between two defining points. Only the point's projection on the circle matters, which is computed using getPhase(Vector3D).
      Parameters:
      a - first point.
      b - second point.
      Returns:
      an arc of the circle.
    • getTransform Link icon

      Get a Transform embedding a 3D rotation.
      Parameters:
      rotation - rotation to use
      Returns:
      a new transform that can be applied to either Point, Line or SubHyperplane instances