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.hypot(other.x - x, other.y - y)
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
to_ary()
Alias for: to_a