Phaser API Documentation

  Version: 

Member of: Phaser.Geom.Line

<static> GetNearestPoint(line, point, [out])

Description:

Get the nearest point on a line perpendicular to the given point.

Parameters:

name type arguments description
line Phaser.Geom.Line

The line to get the nearest point on.

point object | Phaser.Geom.Point

The point to get the nearest point to.

out object | Phaser.Geom.Point <optional>

An optional point, or point-like object, to store the coordinates of the nearest point on the line.

Returns:
Description:

The nearest point on the line.

Type:
Since: 3.16.0