the circle-line collision object
- Source
Methods
(static) collide(circle, point1, point2, thicknessopt) → {boolean}
returns true if a circle is colliding with a line
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
circle | Object | |||
point1 | Object | first endpoint on the line | ||
point2 | Object | second endpoint on the line | ||
thickness | number | <optional> | 1 | the thickness of the line; stroke weight |
- Source
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:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
circle | Object | |||
point1 | Object | first endpoint on the line | ||
point2 | Object | second endpoint on the line | ||
thickness | number | <optional> | 1 | the thickness of the line; stroke weight |
- Source
Returns:
- the resolution coordinates
- Type:
- Object