AR measure! Calculate the distance between two points with the ARKit

Easily implement AR measure functions

Sorry about Japanese

I want to measure the distance between two points in three dimensions

Do I need complicated calculations?

Easy calculation with ARKit

iOS has a function to hit test a plane and easily measure the distance between two three-dimensional points.
Since sensing is the key to AR, distance calculation is quite accurate.

Procedure

The hit test detects the coordinates of the intersection between the screen tap and the plane.

After that, calculate the distance between the coordinates of the first tap and the coordinates of the second tap with the preset distance function.

0.40427696

The function returns the result in meters.

When I measured a 40 cm ruler, it was calculated to be 40 cm.

Sorry about Japanese

ARKit sensor is excellent

It seems that it can be used for various applications because it can take a surprisingly accurate distance.

🐣

I’m a freelance engineer.
Work consultation
Please feel free to contact us with a brief development description.
rockyshikoku@gmail.com

I am making an app that uses Core ML and ARKit.
We send machine learning / AR related information.

GitHub

Twitter
Medium

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store