How iOS 18 Measure App Calculates Volume

Apple’s Measure app in iOS 18 calculates the volume of rectangular objects by combining advanced augmented reality (AR) frameworks, computer vision, and spatial sensor data. By using either the device's camera alone or pairing it with a LiDAR scanner, the app establishes exact three-dimensional coordinates for designated points. Once the length, width, and height of an object are established, the system applies standard geometric algorithms to compute the total three-dimensional capacity in real time.

Spatial Mapping and Coordinate Tracking

The foundation of the calculation relies on ARKit and Visual-Inertial Odometry (VIO). As you move the iPhone or iPad around an object, the camera captures visual feature points while the device’s accelerometer and gyroscope track physical motion. On Pro models, the LiDAR (Light Detection and Ranging) sensor emits invisible light pulses to measure the precise time of flight to the object’s surface.

Together, these sensors generate a live 3D point cloud and map horizontal and vertical planes, establishing a local real-world coordinate system \((X, Y, Z)\) measured in metric units.

Point Measurement and Raycasting

When a user places points along the edges of a rectangular object, the app uses raycasting:

  1. Ray Projection: The app projects an invisible ray from the camera's 2D screen coordinate through 3D space until it intersects with the detected plane or physical mesh.
  2. Anchor Placement: The intersection point is converted into a 3D vector coordinate \((x, y, z)\).
  3. Automated Snapping: In iOS 18, machine learning edge-detection models analyze high-contrast borders and geometric corners, automatically snapping the measurement points to the true physical boundaries of the object.

Determining Dimensions via Vector Math

To measure a rectangular box, the app requires three primary linear dimensions: length (\(l\)), width (\(w\)), and height (\(h\)).

When measuring point-to-point, the Euclidean distance (\(d\)) between two 3D points, \(A(x_1, y_1, z_1)\) and \(B(x_2, y_2, z_2)\), is calculated using the distance formula:

\[d = \sqrt{(x_2 - x_1)^2 + (y_2 - y_1)^2 + (z_2 - z_1)^2}\]

In automated box-detection mode, the app identifies the bounding box by detecting the base plane and projecting perpendicular vectors upward. Even if a user manually inputs points at slight angles, the software fits a best-fit oriented bounding box (OBB) around the measured points to ensure that the length, width, and height axes remain orthogonal (at 90-degree angles to one another).

Volume Computation

Once the three orthogonal vectors are resolved into scalar values for length, width, and height, the calculation executes instantly:

\[\text{Volume} = \text{Length} \times \text{Width} \times \text{Height}\]

Because the internal coordinate system is calculated in meters, the initial result is derived in cubic meters (\(m^3\)). iOS 18 then converts this raw value into the user's preferred regional format, such as cubic inches, cubic feet, or liters, adjusting dynamically if the user fine-tunes any edge anchors.