# Point

Version: 0.5.0
Framework commit: d503df2befa756e681fcdc6250e9552dc7388bea
Canonical URL: /docs/0.5.0/api/ferroui-base/struct-point/

**struct** · [`ferroui-base`](/docs/0.5.0/api/ferroui-base/) · v0.5.0

```rust
struct Point
```

Defines a point.

[View source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/point.rs#L14)

## Members

- [`x`](#struct_field-x)
- [`y`](#struct_field-y)
- [`new`](#function-new)
- [`distance`](#function-distance)
- [`parse`](#function-parse)
- [`equals`](#function-equals)
- [`nearly_equals`](#function-nearly_equals)
- [`transform`](#function-transform)
- [`with_x`](#function-with_x)
- [`with_y`](#function-with_y)
- [`deconstruct`](#function-deconstruct)

<a id="struct_field-x"></a>

### x

```rust
x: f64
```

The X position.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/point.rs#L16)

<a id="struct_field-y"></a>

### y

```rust
y: f64
```

The Y position.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/point.rs#L18)

<a id="function-new"></a>

### new

```rust
const fn new(x: f64, y: f64) -> Self
```

Initializes a new instance of the `Point` structure.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/point.rs#L24)

<a id="function-distance"></a>

### distance

```rust
fn distance(value1: Point, value2: Point) -> f64
```

Computes the Euclidean distance between the two given points.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/point.rs#L30)

<a id="function-parse"></a>

### parse

```rust
fn parse(s: &str) -> Result<Self, FormatError>
```

Parses a `Point` string (`"x, y"` or `"x y"`).

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/point.rs#L37)

<a id="function-equals"></a>

### equals

```rust
fn equals(self: &Self, other: Point) -> bool
```

Returns a boolean indicating whether the point is equal to the other given
point (bitwise equality of the coordinates is *not* required: this is `==`).

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/point.rs#L45)

<a id="function-nearly_equals"></a>

### nearly_equals

```rust
fn nearly_equals(self: &Self, other: Point) -> bool
```

Returns a boolean indicating whether the point is equal to the other given
point (numerically, within a relative epsilon).

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/point.rs#L52)

<a id="function-transform"></a>

### transform

```rust
fn transform(self: &Self, transform: Matrix) -> Point
```

Transforms the point by a matrix.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/point.rs#L58)

<a id="function-with_x"></a>

### with_x

```rust
const fn with_x(self: &Self, x: f64) -> Point
```

Returns a new point with the specified X coordinate.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/point.rs#L64)

<a id="function-with_y"></a>

### with_y

```rust
const fn with_y(self: &Self, y: f64) -> Point
```

Returns a new point with the specified Y coordinate.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/point.rs#L70)

<a id="function-deconstruct"></a>

### deconstruct

```rust
const fn deconstruct(self: &Self) -> (f64, f64)
```

Deconstructs the point into its X and Y coordinates.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/point.rs#L76)

## Trait implementations

- `Send`
- `Sync`
- `Freeze`
- `UnsafeUnpin`
- `Unpin`
- `UnwindSafe`
- `RefUnwindSafe`
- [`PropertyValue`](/docs/0.5.0/api/ferroui-base/trait-propertyvalue/)
- [`AnyValue`](/docs/0.5.0/api/ferroui-base/trait-anyvalue/)
- [`ClassDefaults`](/docs/0.5.0/api/ferroui-base/trait-classdefaults/)
- `Borrow<T>`
- `BorrowMut<T>`
- `CloneToUninit`
- `Into<U>`
- `From<T>`
- `TryInto<U>`
- `TryFrom<U>`
- `Any`
- `ToOwned`
- `ToString`
- `ErasedDestructor`
- `IntoEither`
- [`Transition<Point>`](/docs/0.5.0/api/ferroui-base/animation/trait-transition/)
- `From<Point>`
- `FromIterator<Point>`
- `BatchValue`
- [`MarkupTyped`](/docs/0.5.0/api/ferroui-base/metadata/trait-markuptyped/)
- [`ValueTypeRegistration`](/docs/0.5.0/api/ferroui-base/data/core/trait-valuetyperegistration/)
- `Clone`
- `Copy`
- `Debug`
- `StructuralPartialEq`
- `PartialEq`
- `Default`
- `Neg`
- `Add`
- `Add<Vector>`
- `Sub`
- `Sub<Vector>`
- `Mul<f64>`
- `Mul<Point>`
- `Div<f64>`
- `Mul<Matrix>`
- `AddAssign`
- `AddAssign<Vector>`
- `SubAssign`
- `SubAssign<Vector>`
- `MulAssign<f64>`
- `DivAssign<f64>`
- `MulAssign<Matrix>`
- `FromStr`
- `Display`
- `From<Vector>`

## Availability

Extracted for `aarch64-apple-darwin`. Cargo features are listed in the [crate index](/docs/0.5.0/api/).
