<!--
{
  "availability" : [
    "iOS: 13.0.0 -",
    "iPadOS: 13.0.0 -",
    "macCatalyst: 13.0.0 -",
    "macOS: 10.15.0 -",
    "tvOS: 13.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 6.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "SwiftUI",
  "identifier" : "/documentation/SwiftUI/VectorArithmetic",
  "metadataVersion" : "0.1.0",
  "role" : "Protocol",
  "symbol" : {
    "kind" : "Protocol",
    "modules" : [
      "SwiftUI"
    ],
    "preciseIdentifier" : "s:7SwiftUI16VectorArithmeticP"
  },
  "title" : "VectorArithmetic"
}
-->

# VectorArithmetic

A type that can serve as the animatable data of an animatable type.

```
protocol VectorArithmetic : AdditiveArithmetic
```

## Overview

`VectorArithmetic` extends the `AdditiveArithmetic` protocol with scalar
multiplication and a way to query the vector magnitude of the value. Use
this type as the `animatableData` associated type of a type that conforms to
the [`Animatable`](/documentation/SwiftUI/Animatable) protocol.

## Topics

### Manipulating values

[`magnitudeSquared`](/documentation/SwiftUI/VectorArithmetic/magnitudeSquared)

Returns the dot-product of this vector arithmetic instance with itself.

[`scale(by:)`](/documentation/SwiftUI/VectorArithmetic/scale(by:))

Multiplies each component of this value by the given value.

[`scaled(by:)`](/documentation/SwiftUI/VectorArithmetic/scaled(by:))

Returns a value with each component of this value multiplied by the
given value.

[`interpolate(towards:amount:)`](/documentation/SwiftUI/VectorArithmetic/interpolate(towards:amount:))

Interpolates this value with `other` by the specified `amount`.

[`interpolated(towards:amount:)`](/documentation/SwiftUI/VectorArithmetic/interpolated(towards:amount:))

Returns this value interpolated with `other` by the specified `amount`.



---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)