module PF::Shape

Defined in:

shape.cr

Class Method Summary

Class Method Detail

def self.average_radius(points : Enumerable(Vector2)) #

calculate length from center for all points, and then get the average


[View source]
def self.circle(num_points : Int, size = 1.0, jitter = 0.0) #

Generate an array of points that form a circle


[View source]
def self.rotate(points : Enumerable(Vector2), rotation : Float64) #

Rotate points by rotation


[View source]
def self.scale(points : Enumerable(Vector2), amount : Vector2) #

Scale points by a certain amount


[View source]
def self.translate(points : Enumerable(Vector2), translation : Vector2) #

Translate points by translation


[View source]
def self.translate(*points : Vector2, translation : Vector2) #

ditto


[View source]