shared
utils
string
object
is
extension
js
tracking
string
dom
when
selection
position
iframe
event
scroll
console
node
string
project
fs
console
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
- center*-Vector2
The center point of the circle
- radius*-Number
The radius to constrain the point in
- point*-Vector2
The point to constrain
Return
- -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
Author
- Olivier Bosselolivier.bossel@gmail.comhttps://blackbyte.space