(t *testing.T)
| 134 | } |
| 135 | |
| 136 | func TestPoint(t *testing.T) { |
| 137 | p := Point{3, 4} |
| 138 | test.T(t, p.Mul(2.0), Point{6, 8}) |
| 139 | test.T(t, p.Div(3.0), Point{1, 4.0 / 3.0}) |
| 140 | test.T(t, p.Rot90CW(), Point{4, -3}) |
| 141 | test.T(t, p.Rot90CCW(), Point{-4, 3}) |
| 142 | test.T(t, p.Rot(90*math.Pi/180.0, Point{}), p.Rot90CCW()) |
| 143 | test.T(t, p.Rot(90*math.Pi/180.0, p), p) |
| 144 | test.Float(t, p.Dot(Point{3, 0}), 9.0) |
| 145 | test.Float(t, p.PerpDot(Point{3, 0}), p.Rot90CCW().Dot(Point{3, 0})) |
| 146 | test.Float(t, p.Length(), 5.0) |
| 147 | test.Float(t, p.Slope(), 4.0/3.0) |
| 148 | test.Float(t, p.Angle()*180.0/math.Pi, 53.1301023542) |
| 149 | test.Float(t, p.AngleBetween(p.Rot90CCW())*180.0/math.Pi, 90.0) |
| 150 | test.Float(t, Point{0, 0}.AngleBetween(p)*180.0/math.Pi, 0.0) |
| 151 | test.Float(t, p.AngleBetween(Point{0, 0})*180.0/math.Pi, 0.0) |
| 152 | test.Float(t, p.AngleBetween(p)*180.0/math.Pi, 0.0) |
| 153 | test.T(t, p.Norm(3.0), Point{1.8, 2.4}) |
| 154 | test.T(t, p.Norm(0.0), Point{0.0, 0.0}) |
| 155 | test.T(t, Point{}.Norm(1.0), Point{0.0, 0.0}) |
| 156 | test.T(t, Point{}.Interpolate(p, 0.5), Point{1.5, 2.0}) |
| 157 | test.String(t, p.String(), "(3,4)") |
| 158 | } |
| 159 | |
| 160 | func TestRect(t *testing.T) { |
| 161 | r := Rect{0, 0, 5, 5} |
nothing calls this directly
no test coverage detected