ur_rna.Utilities.geom

## Class PointMath

- java.lang.Object
- - ur_rna.Utilities.geom.PointMath

-     public class PointMath
      extends java.lang.Object

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `PointMath()`

  - ### Method Summary

    All Methods Static Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static java.awt.geom.Point2D` | `diff(java.awt.geom.Point2D p1, java.awt.geom.Point2D p2)`
    `static java.awt.geom.Point2D` | `diff(java.awt.geom.Point2D p1, java.awt.geom.Point2D p2, java.awt.geom.Point2D result)` sets result to p1 - p2.
    `static double` | `dist(java.awt.geom.Point2D p1, java.awt.geom.Point2D p2)`
    `static double` | `distSqr(java.awt.geom.Point2D p1, java.awt.geom.Point2D p2)`
    `static double` | `magnitude(java.awt.geom.Point2D p)` Returns the absolute length of the vector pointing to p
    `static java.awt.geom.Point2D` | `midpoint(java.awt.geom.Point2D p1, java.awt.geom.Point2D p2)`
    `static java.awt.geom.Point2D` | `midpoint(java.awt.geom.Point2D p1, java.awt.geom.Point2D p2, java.awt.geom.Point2D result)` Returns the mid-point between two points.
    `static java.awt.geom.Point2D` | `negate(java.awt.geom.Point2D p)` sets result to -p.
    `static java.awt.geom.Point2D` | `negative(java.awt.geom.Point2D p)`
    `static java.awt.geom.Point2D` | `negative(java.awt.geom.Point2D p, java.awt.geom.Point2D result)` sets result to -p.
    `static java.awt.geom.Point2D` | `normalize(java.awt.geom.Point2D p)` Assumes p represents a vector and mormalizes it to a unit vector -- i.e.
    `static java.awt.geom.Point2D` | `normalized(java.awt.geom.Point2D p)`
    `static java.awt.geom.Point2D` | `normalized(java.awt.geom.Point2D p, java.awt.geom.Point2D result)` Assumes p is a vector and sets result to the corresponding normalized unit vector (i.e.
    `static java.awt.geom.Point2D` | `scale(java.awt.geom.Point2D p, double factor)` scales p by the given factor.
    `static java.awt.geom.Point2D` | `scale(java.awt.geom.Point2D p, double sx, double sy)`
    `static java.awt.geom.Point2D` | `scaled(java.awt.geom.Point2D p, double scale)`
    `static java.awt.geom.Point2D` | `scaled(java.awt.geom.Point2D p, double sx, double sy)`
    `static java.awt.geom.Point2D` | `scaled(java.awt.geom.Point2D p, double sx, double sy, java.awt.geom.Point2D result)`
    `static java.awt.geom.Point2D` | `scaled(java.awt.geom.Point2D p, double scale, java.awt.geom.Point2D result)` sets result to scale * p.
    `static java.awt.geom.Point2D` | `sum(java.awt.geom.Point2D p, double dx, double dy)`
    `static java.awt.geom.Point2D` | `sum(java.awt.geom.Point2D p, double dx, double dy, java.awt.geom.Point2D result)` sets result to (p.x + dx, p.y + dy) If result is null, a new Point2D (cloned from p1) will be returned.
    `static java.awt.geom.Point2D` | `sum(java.awt.geom.Point2D p1, java.awt.geom.Point2D p2)`
    `static java.awt.geom.Point2D` | `sum(java.awt.geom.Point2D p1, java.awt.geom.Point2D p2, java.awt.geom.Point2D result)` sets result to p1 + p2.
    `static java.awt.geom.Point2D` | `translate(java.awt.geom.Point2D p, double dx, double dy)` ranslates p by (dx, dy).
    `static java.awt.geom.Point2D` | `translate(java.awt.geom.Point2D p, java.awt.geom.Point2D delta)` translates p by (p.x, p.y).

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### PointMath

          public PointMath()

  - ### Method Detail

    - #### diff

          public static java.awt.geom.Point2D diff(java.awt.geom.Point2D p1,
                                                   java.awt.geom.Point2D p2)

    - #### diff

          public static java.awt.geom.Point2D diff(java.awt.geom.Point2D p1,
                                                   java.awt.geom.Point2D p2,
                                                   java.awt.geom.Point2D result)

      sets result to p1 - p2. If result is null, a new Point2D (cloned from p1) will be returned.

    - #### dist

          public static double dist(java.awt.geom.Point2D p1,
                                    java.awt.geom.Point2D p2)

    - #### distSqr

          public static double distSqr(java.awt.geom.Point2D p1,
                                       java.awt.geom.Point2D p2)

    - #### magnitude

          public static double magnitude(java.awt.geom.Point2D p)

      Returns the absolute length of the vector pointing to p

    - #### midpoint

          public static java.awt.geom.Point2D midpoint(java.awt.geom.Point2D p1,
                                                       java.awt.geom.Point2D p2)

    - #### midpoint

          public static java.awt.geom.Point2D midpoint(java.awt.geom.Point2D p1,
                                                       java.awt.geom.Point2D p2,
                                                       java.awt.geom.Point2D result)

      Returns the mid-point between two points.

    - #### negate

          public static java.awt.geom.Point2D negate(java.awt.geom.Point2D p)

      sets result to -p. Returns p itself (for chaining).

    - #### negative

          public static java.awt.geom.Point2D negative(java.awt.geom.Point2D p)

    - #### negative

          public static java.awt.geom.Point2D negative(java.awt.geom.Point2D p,
                                                       java.awt.geom.Point2D result)

      sets result to -p. If result is null, a new Point2D (cloned from p) will be returned.

    - #### normalize

          public static java.awt.geom.Point2D normalize(java.awt.geom.Point2D p)

      Assumes p represents a vector and mormalizes it to a unit vector -- i.e. divides x and y by the magnitude of vector (x, y).

    - #### normalized

          public static java.awt.geom.Point2D normalized(java.awt.geom.Point2D p)

    - #### normalized

          public static java.awt.geom.Point2D normalized(java.awt.geom.Point2D p,
                                                         java.awt.geom.Point2D result)

      Assumes p is a vector and sets result to the corresponding normalized unit vector (i.e. divides x and y by the magnitude of vector (x, y). If result is null, a new Point2D (cloned from p) will be returned.

    - #### scale

          public static java.awt.geom.Point2D scale(java.awt.geom.Point2D p,
                                                    double factor)

      scales p by the given factor. Returns p itself (for chaining).

    - #### scale

          public static java.awt.geom.Point2D scale(java.awt.geom.Point2D p,
                                                    double sx,
                                                    double sy)

    - #### scaled

          public static java.awt.geom.Point2D scaled(java.awt.geom.Point2D p,
                                                     double scale)

    - #### scaled

          public static java.awt.geom.Point2D scaled(java.awt.geom.Point2D p,
                                                     double sx,
                                                     double sy)

    - #### scaled

          public static java.awt.geom.Point2D scaled(java.awt.geom.Point2D p,
                                                     double sx,
                                                     double sy,
                                                     java.awt.geom.Point2D result)

    - #### scaled

          public static java.awt.geom.Point2D scaled(java.awt.geom.Point2D p,
                                                     double scale,
                                                     java.awt.geom.Point2D result)

      sets result to scale * p. If result is null, a new Point2D (cloned from p) will be returned.

    - #### sum

          public static java.awt.geom.Point2D sum(java.awt.geom.Point2D p,
                                                  double dx,
                                                  double dy)

    - #### sum

          public static java.awt.geom.Point2D sum(java.awt.geom.Point2D p,
                                                  double dx,
                                                  double dy,
                                                  java.awt.geom.Point2D result)

      sets result to (p.x + dx, p.y + dy) If result is null, a new Point2D (cloned from p1) will be returned.

    - #### sum

          public static java.awt.geom.Point2D sum(java.awt.geom.Point2D p1,
                                                  java.awt.geom.Point2D p2)

    - #### sum

          public static java.awt.geom.Point2D sum(java.awt.geom.Point2D p1,
                                                  java.awt.geom.Point2D p2,
                                                  java.awt.geom.Point2D result)

      sets result to p1 + p2. If result is null, a new Point2D (cloned from p1) will be returned.

    - #### translate

          public static java.awt.geom.Point2D translate(java.awt.geom.Point2D p,
                                                        double dx,
                                                        double dy)

      ranslates p by (dx, dy). Returns p itself (for chaining).

    - #### translate

          public static java.awt.geom.Point2D translate(java.awt.geom.Point2D p,
                                                        java.awt.geom.Point2D delta)

      translates p by (p.x, p.y). Returns p itself (for chaining).