collision. circleLine

the circle-line collision object

Methods

(static) collide(circle, point1, point2, thicknessopt) → {boolean}

returns true if a circle is colliding with a line

Parameters:
NameTypeAttributesDefaultDescription
circleObject
point1Object

first endpoint on the line

point2Object

second endpoint on the line

thicknessnumber<optional>
1

the thickness of the line; stroke weight

Returns:
Type: 
boolean

(static) physics(circle, point1, point2, thicknessopt) → {Object}

returns the resolved position of a circle if the circle is colliding with a line

Parameters:
NameTypeAttributesDefaultDescription
circleObject
point1Object

first endpoint on the line

point2Object

second endpoint on the line

thicknessnumber<optional>
1

the thickness of the line; stroke weight

Returns:
  • the resolution coordinates
Type: 
Object