module PF::Shape

Defined in:

shape.cr

Class Method Summary

Class Method Detail

def self.average_radius(points : Enumerable(PF2d::Vec)) #

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(PF2d::Vec), rotation : Float64) #

Rotate points by rotation


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

Scale points by a certain amount


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

Translate points by translation


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

ditto


[View source]