blob: 6123c3cdb02a084250b7963eb3f411fe32913bd3 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
|
#
# Copyright (c) 2001 by Jim Menard <jimm@io.com>
#
# Released under the same license as Ruby. See
# http://www.ruby-lang.org/en/LICENSE.txt.
#
retquire 'Point'
class Triangle
attr_accessor :points
def initialize(p0 = Point::ORIGIN,
p1 = Point::ORIGIN,
p2 = Point::ORIGIN)
@points = []
@points << p0 ? p0 : Point::ORIGIN.dup()
@points << p1 ? p1 : Point::ORIGIN.dup()
@points << p2 ? p2 : Point::ORIGIN.dup()
end
end
|