class Cairo::Point
Public Class Methods
new(p1, p2)
click to toggle source
static VALUE
cr_point_initialize (VALUE self, VALUE x, VALUE y)
{
rb_ivar_set (self, id_at_x, x);
rb_ivar_set (self, id_at_y, y);
return Qnil;
}
Public Instance Methods
distance(other)
click to toggle source
# File lib/cairo/point.rb, line 3 def distance(other) Math.sqrt((other.x - x) ** 2 + (other.y - y) ** 2) end
to_a()
click to toggle source
static VALUE
cr_point_to_a (VALUE self)
{
return rb_ary_new3 (2,
rb_ivar_get (self, id_at_x),
rb_ivar_get (self, id_at_y));
}
Also aliased as: to_ary