Tangent.fromAngle constructor

Tangent.fromAngle(
  1. Offset position,
  2. double angle
)

Creates a Tangent based on the angle rather than the vector.

The vector is computed to be the unit vector at the given angle, interpreted as clockwise radians from the x axis.

Implementation

factory Tangent.fromAngle(Offset position, double angle) {
  return Tangent(position, Offset(math.cos(angle), math.sin(angle)));
}