circleConstrain

Type:Function
Status:stable
Since:1.0.0
Platform:jsnode
@blackbyte.sugar.shared.math

Take as parameter a central point, a radius and a points to constrain inside the circle defined by the radius

Params

  1. center*-Vector2

    The center point of the circle

  2. radius*-Number

    The radius to constrain the point in

  3. point*-Vector2

    The point to constrain

Return

  1. -Vector2

    The new constrained value for the point

Example

import { circleConstrain } from '@blackbyte/sugar/math'
circleConstrain({
	x: 10, y: 10
}, 10, {
	x: 10, y: 5
})

Todo

  • testsnormal