def testComputeXAxisLabelXCoordAndDirection_X_pos_X_pos(self): origin = (720, 530) ccs = TwoDCartesianCoordSystem(origin, xLength=200, yLength=400, xRange=(25, 55), yRange=(50, 3), titleLst=["xR=(25,55)", "yR=(50,3)"]) self.assertEqual((920, 1), ccs.computeXAxisLabelXCoordAndDirection(origin, (720, 530), (920, 530)))
def testComputeXAxisLabelXCoordAndDirection_X_neg_X_neg(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((945, -1), ccs.computeXAxisLabelXCoordAndDirection(origin, (945, 550), (1145, 550)))
def testComputeXAxisLabelXCoordAndDirection_X_neg_X_pos(self): origin = (80, 400) ccs = TwoDCartesianCoordSystem(origin=origin, xLength=200, yLength=300, xRange=(-5, 15), yRange=(50, -3), titleLst=["xR=(-5,15)", "yR=(50,-3)"]) self.assertEqual((260, 1), ccs.computeXAxisLabelXCoordAndDirection(origin, (60, 400), (260, 400)))