Phaser API Documentation

  Version: 

Member of: Phaser.Geom.Point

<static> ProjectUnit(pointA, pointB, [out])

Description:

Calculates the vector projection of pointA onto the nonzero pointB. This is the orthogonal projection of pointA onto a straight line paralle to pointB.

Parameters:

name type arguments description
pointA Phaser.Geom.Point

Point A, to be projected onto Point B. Must be a normalized point with a magnitude of 1.

pointB Phaser.Geom.Point

Point B, to have Point A projected upon it.

out Phaser.Geom.Point <optional>

The Point object to store the position in. If not given, a new Point instance is created.

Returns:
Description:

A unit Point object holding the coordinates of the vector projection of pointA onto pointB.

Since: 3.0.0