def _radius_from_point_and_angle(self, point, angle): line = QLineF() line.setP1(point) line.setAngle(angle) normal = line.normalVector() normal.setLength(self.magic_number / 2) return QPointF(normal.dx(), normal.dy())
def apply_rotation(self, angle, center): """Applies rotation. Args: angle (float): The angle in degrees. center (QPoint): Rotates around this point. """ line = QLineF(center, self.pos()) line.setAngle(line.angle() + angle) self.setPos(line.p2()) self.update_arcs_line()
def calculatePerpendicularPoint(self, startingPoint, distance, line): labelHelperLine = QLineF() labelHelperLine.setP1(startingPoint) labelHelperLine.setAngle(line.angle() + 90) labelHelperLine.setLength(distance) return labelHelperLine.p2()