pointFromVector

pointFromVector takes a point, an angle (in degrees), and a distance, and returns a new point.

Import

import { pointFromVector } from '@popmotion/popcorn';

Usage

pointFromVector({ x: 0, y: 0 }, 45, 100);
// { x: 70.710..., y: 70.710... }

Types

type Point = {
  x :number;
  y: number;
};

pointFromVector(origin: Point, angle: number, distance: number): Point