## mpicbg.models Class Point

```java.lang.Object
mpicbg.models.Point
```
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
Vertex

`public class Pointextends Objectimplements Serializable`

An n-dimensional point. `Local coordinates` are thought to be immutable, application of a model changes the `world coordinates` of the point.

Author:
Stephan Saalfeld
Serialized Form

Field Summary
`protected  double[]` `l`
Local coordinates
`protected  double[]` `w`
World coordinates

Constructor Summary
`Point(double[] l)`
Constructor Sets `l` to the given double[] reference.
```Point(double[] l, double[] w)```
Constructor Sets `l` to the given double[] reference.

Method Summary
` void` `apply(CoordinateTransform t)`
Apply a `CoordinateTransform` to the `Point`.
` void` ```apply(CoordinateTransform t, double amount)```
Apply a `CoordinateTransform` to the `Point` by a given amount.
```static <P extends Point> void ``` ```apply(CoordinateTransform t, Iterable<P> points)```
Apply a `CoordinateTransform` to an `Iterable` collection of `Points`.
` void` `applyInverse(InverseCoordinateTransform t)`
Apply the inverse of a `InvertibleModel` to the `Point`.
`static void` ```applyInverse(InverseCoordinateTransform t, Iterable<Point> points)```
Apply an `InverseCoordinateTransform` to an `Iterable` collection of `Points`.
` Point` `clone()`
Clone this `Point` instance.
` double` `distance()`
Estimate the Euclidean distance of local and world coordinates.
`static double` ```distance(Point p1, Point p2)```
Estimate the Euclidean distance of two `Points` in world space.
` double[]` `getL()`

` double[]` `getW()`

`static double` ```localDistance(Point p1, Point p2)```
Estimate the Euclidean distance of two `Points` in local space.
` double` `squareDistance()`
Estimate the square distance of local and world coordinates.
`static double` ```squareDistance(Point p1, Point p2)```
Estimate the square Euclidean distance of two `Points` in world space.
`static double` ```squareLocalDistance(Point p1, Point p2)```
Estimate the square Euclidean distance of two `Points` in local space.

Methods inherited from class java.lang.Object
`equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### w

`protected final double[] w`
World coordinates

### l

`protected final double[] l`
Local coordinates

Constructor Detail

### Point

```public Point(double[] l,
double[] w)```
Constructor Sets `l` to the given double[] reference.

Parameters:
`l` - reference to the local coordinates of the `Point`
`w` - reference to the world coordinates of the `Point`

### Point

`public Point(double[] l)`
Constructor Sets `l` to the given double[] reference.

Parameters:
`l` - reference to the local coordinates of the `Point`
Method Detail

### getW

`public double[] getW()`

### getL

`public double[] getL()`

### apply

`public final void apply(CoordinateTransform t)`
Apply a `CoordinateTransform` to the `Point`. Transfers the `local coordinates` to new `world coordinates`.

Parameters:
`t` -

### apply

```public final void apply(CoordinateTransform t,
double amount)```
Apply a `CoordinateTransform` to the `Point` by a given amount. Transfers the `local coordinates` to new `world coordinates`.

Parameters:
`t` -
`amount` - 0.0 -> no application, 1.0 -> full application

### applyInverse

```public final void applyInverse(InverseCoordinateTransform t)
throws NoninvertibleModelException```
Apply the inverse of a `InvertibleModel` to the `Point`. Transfers the `local coordinates` to new `world coordinates`.

Parameters:
`model` -
Throws:
`NoninvertibleModelException`

### squareDistance

`public double squareDistance()`
Estimate the square distance of local and world coordinates.

Returns:
square distance

### distance

`public double distance()`
Estimate the Euclidean distance of local and world coordinates.

Returns:
square distance

### squareDistance

```public static final double squareDistance(Point p1,
Point p2)```
Estimate the square Euclidean distance of two `Points` in world space.

Parameters:
`p1` -
`p2` -
Returns:
square distance

### distance

```public static final double distance(Point p1,
Point p2)```
Estimate the Euclidean distance of two `Points` in world space.

Parameters:
`p1` -
`p2` -
Returns:
Euclidean distance

### squareLocalDistance

```public static final double squareLocalDistance(Point p1,
Point p2)```
Estimate the square Euclidean distance of two `Points` in local space.

Parameters:
`p1` -
`p2` -
Returns:
square distance

### localDistance

```public static final double localDistance(Point p1,
Point p2)```
Estimate the Euclidean distance of two `Points` in local space.

Parameters:
`p1` -
`p2` -
Returns:
Euclidean distance

### clone

`public Point clone()`
Clone this `Point` instance.

Overrides:
`clone` in class `Object`

### apply

```public static <P extends Point> void apply(CoordinateTransform t,
Iterable<P> points)```
Apply a `CoordinateTransform` to an `Iterable` collection of `Points`. For each `Point`, transfers the `local coordinates` to new `world coordinates`.

Parameters:
`t` -

### applyInverse

```public static void applyInverse(InverseCoordinateTransform t,
Iterable<Point> points)
throws NoninvertibleModelException```
Apply an `InverseCoordinateTransform` to an `Iterable` collection of `Points`. For each `Point`, transfers the `local coordinates` to new `world coordinates`.

Parameters:
`t` -
Throws:
`NoninvertibleModelException`