# Plane3D

`com.jsmacrosce.jsmacros.api.math.Plane3D`

**Since:** 1.6.5

Represents three points in 3D space and derives their edge vectors and normal on demand. The
 public coordinates are writable, so changing them affects subsequent results. The normal is the
 unnormalized cross product of the first two edges; its direction follows the points' order and
 its magnitude is twice the triangle's area. Collinear or repeated points yield a zero normal.

## Constructors

### new Plane3D {#com.jsmacrosce.jsmacros.api.math.Plane3D_constructor-double-double-double-double-double-double-double-double-double-}

```js
new Plane3D(double x1, double y1, double z1, double x2, double y2, double z2, double x3, double y3, double z3)
```

Stores three points used to define the plane. Their order determines the direction of
 [getNormalVector()](#com.jsmacrosce.jsmacros.api.math.Plane3D_getNormalVector-); collinear or repeated points are accepted but yield a zero normal.

**Parameters:**
- `x1`: the x coordinate of the first point
- `y1`: the y coordinate of the first point
- `z1`: the z coordinate of the first point
- `x2`: the x coordinate of the second point
- `y2`: the y coordinate of the second point
- `z2`: the z coordinate of the second point
- `x3`: the x coordinate of the third point
- `y3`: the y coordinate of the third point
- `z3`: the z coordinate of the third point

**Since:** 1.6.5

## Fields

### x1 {#com.jsmacrosce.jsmacros.api.math.Plane3D_x1}

```js
x1: double
```

The x coordinate of the first point.

### x2 {#com.jsmacrosce.jsmacros.api.math.Plane3D_x2}

```js
x2: double
```

The x coordinate of the second point.

### x3 {#com.jsmacrosce.jsmacros.api.math.Plane3D_x3}

```js
x3: double
```

The x coordinate of the third point.

### y1 {#com.jsmacrosce.jsmacros.api.math.Plane3D_y1}

```js
y1: double
```

The y coordinate of the first point.

### y2 {#com.jsmacrosce.jsmacros.api.math.Plane3D_y2}

```js
y2: double
```

The y coordinate of the second point.

### y3 {#com.jsmacrosce.jsmacros.api.math.Plane3D_y3}

```js
y3: double
```

The y coordinate of the third point.

### z1 {#com.jsmacrosce.jsmacros.api.math.Plane3D_z1}

```js
z1: double
```

The z coordinate of the first point.

### z2 {#com.jsmacrosce.jsmacros.api.math.Plane3D_z2}

```js
z2: double
```

The z coordinate of the second point.

### z3 {#com.jsmacrosce.jsmacros.api.math.Plane3D_z3}

```js
z3: double
```

The z coordinate of the third point.

## Methods

### equals {#com.jsmacrosce.jsmacros.api.math.Plane3D_equals-Object-}

```js
equals(Object o): boolean
```

Compares the ordered coordinates of all three points; this does not compare the infinite
 planes or treat reordered points as equivalent. Only the exact same runtime class compares
 equal. Coordinates use [Double.compare(double, double)](https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/lang/Double.html) semantics, including equal NaNs
 and distinct signed zeroes.

**Parameters:**
- `o`: the value to compare

**Returns:** `true` for this instance or an instance of the same class with equal ordered
         coordinates; `false` for `null` or any other value

### getNormalVector {#com.jsmacrosce.jsmacros.api.math.Plane3D_getNormalVector-}

```js
getNormalVector(): Vec3D
```

Returns the cross product of the first and second edges, as a vector from the origin. Its
 direction follows the right-hand rule for the points' order, and its magnitude is twice the
 triangle's area. It is not normalized. Collinear or repeated points yield a zero vector;  
 normalizing that vector produces `NaN` coordinates.

**Returns:** a new vector from the origin to this plane's normal, parallel to the right hand
         rule around the three points in the order they were given

**Since:** 1.6.5

### getVec12 {#com.jsmacrosce.jsmacros.api.math.Plane3D_getVec12-}

```js
getVec12(): Vec3D
```

Returns the edge from the first point to the second.

**Returns:** a new vector from point one to point two

**Since:** 1.6.5

### getVec13 {#com.jsmacrosce.jsmacros.api.math.Plane3D_getVec13-}

```js
getVec13(): Vec3D
```

Returns the segment from the first point to the third.

**Returns:** a new vector from point one to point three

**Since:** 1.6.5

### getVec23 {#com.jsmacrosce.jsmacros.api.math.Plane3D_getVec23-}

```js
getVec23(): Vec3D
```

Returns the edge from the second point to the third.

**Returns:** a new vector from point two to point three

**Since:** 1.6.5

### hashCode {#com.jsmacrosce.jsmacros.api.math.Plane3D_hashCode-}

```js
hashCode(): int
```

Computes a hash from the current coordinates of all three ordered points. Since the
 coordinates are mutable, changing them can change the hash; do not assume this is a stable
 hash key while the coordinates change.

**Returns:** the hash of the current coordinates
