class Geo2D::Coordinate

Defined in:

geo2d/coordinate.cr

Constructors

Instance Method Summary

Constructor Detail

def self.new(coord : Coordinate) #

[View source]
def self.new(angle : Float64) #

[View source]
def self.new(x = 0, y = 0) #

[View source]

Instance Method Detail

def !=(coord : Coordinate) : Bool #

[View source]
def *(other : Coordinate) #

Multiplication two points and return a new coordinate


[View source]
def *(s : Float64) #

Multiplication by Float64


[View source]
def +(other : Coordinate) #

Add two points to each other and return a new coordinate


[View source]
def +(offset : Float64) #

Operator + for offset addition


[View source]
def -(other : Coordinate) #

Subtract two points from each other and return a new coordinate


[View source]
def -(offset : Float64) #

Operator - for offset subtract


[View source]
def /(s : Float64) #

Division by Float64


[View source]
def ==(coord : Coordinate) : Bool #

Checks for the equality of Coordinate


[View source]
def angle #

Angle from (0, 0) to coordinate


[View source]
def angle_between(point1 : Coordinate, point2 : Coordinate) #

The angle between two points using the current point as the center


[View source]
def angle_to(point : Coordinate) #

Returns angle To the coordinate


[View source]
def clone #

[View source]
def distance_to(point : Coordinate) #

Calculate the distance between this coordinate and another coordinate


[View source]
def dot(coord : Coordinate) #

Dot product with other coordinate : return _x * coord._x + _y * coord._y


[View source]
def flip_xy #

Flips the x and y of Coordinate


[View source]
def magnitude #

Magnitude or length of the point relative to zero


[View source]
def midpoint(other : Coordinate) #

Midpoint between two coordinates


[View source]
def mirror(axis1 : Coordinate, axis2 : Coordinate) #

Mirror a coordinate axis1 : First point of line to be mirrored about axis2 : Second point of line to be mirrored about


[View source]
def move(direction : Coordinate, d : Float64) #

Move the coordinate by distance d over vector direction


[View source]
def move_to(to : Coordinate, d : Float64) #

Move the coordinate in the direction of point 'to' with distance d


[View source]
def norm #

Normalised version of this coordinate


[View source]
def rotate(point : Coordinate, angle_vector : Coordinate) #

Rotate around a point with a given angle vector


[View source]
def rotate(point : Coordinate, angle : Float64) #

Rotate around a point with a given angle


[View source]
def rotate(angle_vector : Coordinate) #

Rotate around (0.,0.) with a given angle vector


[View source]
def rotate(angle : Float64) #

Rotate around (0.,0.) with a given angle


[View source]
def rotate_by_arc_length(point : Coordinate, length : Float64) #

Around a point where the rotation described length is known


[View source]
def scale(scale_center : Coordinate, scale_factor : Coordinate) #

Scales this coordinate by the given factors with the given center


[View source]
def scale(scale_factor : Float64) #

Scales the coordinate by given factor with (0, 0) as center


[View source]
def scale(scale_factor : Coordinate) #

Scales the coordinate by given factors with (0, 0) as center


[View source]
def squared #

Squared of this Coordinate : return x * x + y * y


[View source]
def x : Float64 #

[View source]
def x=(x : Float64) #

[View source]
def y : Float64 #

[View source]
def y=(y : Float64) #

[View source]