예제 #1
0
	def testComputeYAxisArrowCoordinates_Y_pos_Y_neg(self):
		origin = (300, 255)
		ccs = TwoDCartesianCoordSystem(origin, xLength=200, yLength=300, xRange=(-5, 15),
									   yRange=(30, -40), xLabel='Time', yLabel='Speed',
									   titleLst=["xR=(-5,15)", "yR=(30,-40)"])

		self.assertEqual(((285.0, 265), (300, 225), (315.0, 265)), ccs.computeYAxisArrowCoordinates(origin, (300, 225), (300, 525)))
예제 #2
0
	def testComputeYAxisArrowCoordinates_Y_neg_Y_neg(self):
		origin = (300, 570)
		ccs = TwoDCartesianCoordSystem(origin, xLength=200, yLength=200, xRange=(0, 55),
										   yRange=(-50, -3), titleLst=["xR=(0,55)", "yR=(-50,-3)"])

		self.assertEqual(((285.0, 580), (300, 620), (315.0, 580)), ccs.computeYAxisArrowCoordinates(origin, (300, 570), (300, 620)))
예제 #3
0
	def testComputeYAxisArrowCoordinates_Y_pos_Y_pos(self):
		origin = (500, 530)
		ccs = TwoDCartesianCoordSystem(origin, xLength=200, yLength=400, xRange=(0, 15),
										   yRange=(50, 3), titleLst=["xR=(0,15)", "yR=(50,3)"])

		self.assertEqual(((485.0, 520), (500, 480), (515.0, 520)), ccs.computeYAxisArrowCoordinates(origin, (500, 480), (500, 530)))
예제 #4
0
	def testComputeYAxisArrowCoordinates_Y_pos_Y_zero(self):
		origin = (1145, 550)
		ccs = TwoDCartesianCoordSystem(origin, xLength=200, yLength=400,
										   xRange=(-55, -5), yRange=(50, 0), titleLst=["xR=(-55,-5)", "yR=(50,0)"])

		self.assertEqual(((1130.0, 540), (1145, 500), (1160.0, 540)), ccs.computeYAxisArrowCoordinates(origin, (1145, 500), (1145, 550)))