Class Circle2
Defined in: lina.js.
Constructor Attributes | Constructor Name and Description |
---|---|
Circle2(center, r)
Create a new circle.
|
Method Attributes | Method Name and Description |
---|---|
area()
Return circle area (Pi*r^2).
|
|
contains(pt)
Check, if pt is inside this polygon.
|
|
copy()
Create and return a copy of this circle.
|
|
intersectsCircle(circle2, velocity, velocity2, time)
Check, if this circle intersects with another (moving) circle.
|
|
perimeter(closed)
Return the circumference (2*Pi*r).
|
|
set(center, r)
|
|
toString()
Return string representation 'Circle2((x,y), r=_)'.
|
|
<static> |
Circle2.transform(circle, m)
Return a transformed copy of a cirlcle.
|
transform(m)
Apply transformation matrix (in-place) and return this instance.
|
Method Detail
area()
Return circle area (Pi*r^2).
This assumes an implicitly closed, non self-intersecting polygon.
contains(pt)
Check, if pt is inside this polygon.
- Parameters:
- pt
copy()
Create and return a copy of this circle.
intersectsCircle(circle2, velocity, velocity2, time)
Check, if this circle intersects with another (moving) circle.
Return false, if ther is no intersection within the current time frame.
Otherwise return a dictionary with additional infos.
- Parameters:
- {Circle2} circle2
- {Vec2} velocity
- Speed of this circle in units per second.
- {Vec2} velocity2
- Speed of circle2 in units per second.
- {float} time
- seconds to look ahead (e.g. 1/30s for one frame step). Default: 1
perimeter(closed)
Return the circumference (2*Pi*r).
- Parameters:
- {boolean} closed
- Include implicit closing segment (default: true).
set(center, r)
- Parameters:
- center
- r
toString()
Return string representation 'Circle2((x,y), r=_)'.
<static>
Circle2.transform(circle, m)
Return a transformed copy of a cirlcle.
- Parameters:
- circle
- m
transform(m)
Apply transformation matrix (in-place) and return this instance.
- Parameters:
- m