org.apache.lucene.spatial.geometry.shape

## Class Vector2D

- java.lang.Object
- - org.apache.lucene.spatial.geometry.shape.Vector2D

-     public class Vector2D
      extends java.lang.Object

  2D vector

  NOTE: This API is still in flux and might change in incompatible ways in the next release.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `Vector2D()`
    `Vector2D(double x, double y)` Create a vector from the origin of the coordinate system to the given point
    `Vector2D(Point2D p)` Create a vector from the origin of the coordinate system to the given point
    `Vector2D(Point2D from, Point2D to)` Create a vector from one point to another
    `Vector2D(Vector2D other)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `double` | `dot(Vector2D in)`
    `boolean` | `equals(java.lang.Object obj)`
    `boolean` | `equals(Vector2D other)`
    `double` | `getX()`
    `double` | `getY()`
    `int` | `hashCode()`
    `Vector2D` | `mult(double d)`
    `double` | `norm()`
    `double` | `normSqr()` Vector length (magnitude) squared
    `void` | `set(double x, double y)`
    `void` | `setX(double x)`
    `void` | `setY(double y)`

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

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

- - ### Constructor Detail

    - #### Vector2D

          public Vector2D(double x,
                          double y)

      Create a vector from the origin of the coordinate system to the given point
      Parameters:
        `x` -
        `y` -

    - #### Vector2D

          public Vector2D(Point2D p)

      Create a vector from the origin of the coordinate system to the given point

    - #### Vector2D

          public Vector2D(Point2D from,
                          Point2D to)

      Create a vector from one point to another
      Parameters:
        `from` -
        `to` -

    - #### Vector2D

          public Vector2D()

    - #### Vector2D

          public Vector2D(Vector2D other)

  - ### Method Detail

    - #### getX

          public double getX()

    - #### getY

          public double getY()

    - #### setX

          public void setX(double x)

    - #### setY

          public void setY(double y)

    - #### set

          public void set(double x,
                          double y)

    - #### equals

          public boolean equals(Vector2D other)

    - #### dot

          public double dot(Vector2D in)

    - #### normSqr

          public double normSqr()

      Vector length (magnitude) squared

    - #### norm

          public double norm()

    - #### mult

          public Vector2D mult(double d)

    - #### hashCode

          public int hashCode()

      Overrides:
        `hashCode` in class `java.lang.Object`

    - #### equals

          public boolean equals(java.lang.Object obj)

      Overrides:
        `equals` in class `java.lang.Object`

Copyright © 2000-2016 Apache Software Foundation. All Rights Reserved.