Tangent.fromAngle constructor

Tangent.fromAngle(Offset position, 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)));
}