Phaser API Documentation


Member of: Phaser.Curves.Curve

getTangent(t, [out])


Get a unit vector tangent at a relative position on the curve. In case any sub curve does not implement its tangent derivation, 2 points a small delta apart will be used to find its gradient which seems to give a reasonable approximation


name type arguments description
t number

The relative position on the curve, [0..1].

out Phaser.Math.Vector2 <optional>

A vector to store the result in.


Vector approximating the tangent line at the point t (delta +/- 0.0001)

Since: 3.0.0
Source: src/curves/Curve.js (Line 430)