FMath::PointDistToLine

Calculates the distance of a given Point in world space to a given line, defined by the vector couple (Origin, Direction).

Windows
MacOS
Linux

References

Module

Core

Header

/Engine/Source/Runtime/Core/Public/Math/UnrealMathUtility.h

Include

#include "Math/UnrealMathUtility.h"

Source

/Engine/Source/Runtime/Core/Private/Math/UnrealMath.cpp

Syntax

static float PointDistToLine
(
    const FVector & Point,
    const FVector & Direction,
    const FVector & Origin
)

Remarks

Calculates the distance of a given Point in world space to a given line, defined by the vector couple (Origin, Direction).

Returns

distance of Point from line defined by (Origin, Direction)

Parameters

Parameter

Description

Point

Point to check distance to line

Direction

Vector indicating the direction of the line. Not required to be normalized.

Origin

Point of reference used to calculate distance

OutClosestPoint

optional point that represents the closest point projected onto Axis

Help shape the future of Unreal Engine documentation! Tell us how we're doing so we can serve you better.
Take our survey
Dismiss