Lines Matching refs:nav
250 self.nav = turtle.TNavigator()
253 self.nav.goto(100, -100)
254 self.assertAlmostEqual(self.nav.xcor(), 100)
255 self.assertAlmostEqual(self.nav.ycor(), -100)
258 self.assertEqual(self.nav.pos(), self.nav._position)
259 self.nav.goto(100, -100)
260 self.assertEqual(self.nav.pos(), self.nav._position)
263 self.assertEqual(self.nav._orient, (1.0, 0))
264 self.nav.left(90)
265 self.assertVectorsAlmostEqual(self.nav._orient, (0.0, 1.0))
268 self.assertEqual(self.nav._orient, (1.0, 0))
269 self.nav.right(90)
270 self.assertVectorsAlmostEqual(self.nav._orient, (0, -1.0))
273 self.nav.goto(100, -100)
274 self.assertAlmostEqual(self.nav.xcor(), 100)
275 self.assertAlmostEqual(self.nav.ycor(), -100)
276 self.nav.reset()
277 self.assertAlmostEqual(self.nav.xcor(), 0)
278 self.assertAlmostEqual(self.nav.ycor(), 0)
281 self.nav.forward(150)
283 self.assertVectorsAlmostEqual(self.nav.position(), expected)
285 self.nav.reset()
286 self.nav.left(90)
287 self.nav.forward(150)
289 self.assertVectorsAlmostEqual(self.nav.position(), expected)
291 self.assertRaises(TypeError, self.nav.forward, 'skldjfldsk')
294 self.nav.back(200)
296 self.assertVectorsAlmostEqual(self.nav.position(), expected)
298 self.nav.reset()
299 self.nav.right(90)
300 self.nav.back(200)
302 self.assertVectorsAlmostEqual(self.nav.position(), expected)
305 self.nav.forward(100)
307 self.assertAlmostEqual(self.nav.distance(Vec2D(0,0)), expected)
310 self.nav.left(90)
311 self.assertAlmostEqual(self.nav.heading(), 90)
312 self.nav.radians()
313 self.assertAlmostEqual(self.nav.heading(), 1.57079633)
314 self.nav.degrees()
315 self.assertAlmostEqual(self.nav.heading(), 90)
332 self.assertEqual(self.nav.towards(x, y), expected)
333 self.assertEqual(self.nav.towards((x, y)), expected)
334 self.assertEqual(self.nav.towards(Vec2D(x, y)), expected)
338 self.nav.left(90)
339 self.assertAlmostEqual(self.nav.heading(), 90)
340 self.nav.left(45)
341 self.assertAlmostEqual(self.nav.heading(), 135)
342 self.nav.right(1.6)
343 self.assertAlmostEqual(self.nav.heading(), 133.4)
344 self.assertRaises(TypeError, self.nav.right, 'sdkfjdsf')
345 self.nav.reset()
350 self.nav.left(num)
351 self.assertEqual(self.nav.heading(), result)
352 self.nav.reset()
356 self.nav.right(num)
357 self.assertEqual(self.nav.heading(), result)
358 self.nav.reset()
364 self.nav.right(abs(num))
366 self.nav.left(num)
368 self.assertAlmostEqual(self.nav.heading(), sum_so_far % 360)
371 self.nav.setheading(102.32)
372 self.assertAlmostEqual(self.nav.heading(), 102.32)
373 self.nav.setheading(-123.23)
374 self.assertAlmostEqual(self.nav.heading(), (-123.23) % 360)
375 self.nav.setheading(-1000.34)
376 self.assertAlmostEqual(self.nav.heading(), (-1000.34) % 360)
377 self.nav.setheading(300000)
378 self.assertAlmostEqual(self.nav.heading(), 300000%360)
381 self.nav.forward(100)
382 self.nav.left(90)
383 self.nav.forward(-200)
384 self.assertVectorsAlmostEqual(self.nav.pos(), (100.0, -200.0))
387 self.nav.setx(-1023.2334)
388 self.nav.sety(193323.234)
389 self.assertVectorsAlmostEqual(self.nav.pos(), (-1023.2334, 193323.234))
392 self.nav.left(30)
393 self.nav.forward(-100000)
394 self.nav.home()
395 self.assertVectorsAlmostEqual(self.nav.pos(), (0,0))
396 self.assertAlmostEqual(self.nav.heading(), 0)
399 self.assertAlmostEqual(self.nav.distance(30, 40), 50)
401 self.assertAlmostEqual(self.nav.distance(vec), 0.22000227271553355)
405 self.assertAlmostEqual(self.nav.distance(another_turtle), 10000)