Back to FabImage Library website

You are here: Start » Function Reference » Geometry 2D » Geometry 2D Distance Metrics » PointToPointDistance

PointToPointDistance


Header: FIL.h
Namespace: fil
Module: FoundationLite

Measures the distance between two points.

Syntax

C++
C#
 
void fil::PointToPointDistance
(
	const fil::Point2D& inPoint1,
	const fil::Point2D& inPoint2,
	float inResolution,
	float& outDistance,
	ftl::Optional<fil::Segment2D&> outConnectingSegment = ftl::NIL
)

Parameters

Name Type Range Default Description
Input value
inPoint1 const Point2D&
Input value
inPoint2 const Point2D&
Input value
inResolution float 0.0 - 1.0f Number of real-world units per one pixel
Output value
outDistance float&
Output value
outConnectingSegment Optional<Segment2D&> NIL

Optional Outputs

The computation of following outputs can be switched off by passing value ftl::NIL to these parameters: outConnectingSegment.

Read more about Optional Outputs.

Examples

PointToPointDistance performed on two sample points. The green segment is the value of outConnectingSegment output.