From 9ce92551e20b16a025624196297c9690e741507c Mon Sep 17 00:00:00 2001 From: TurnMeOn Date: Wed, 20 Dec 2017 13:00:10 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=BD=AC=E5=BC=AF=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- car.cpp | 4 ++-- car.h | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/car.cpp b/car.cpp index 6f198a4..1639d28 100644 --- a/car.cpp +++ b/car.cpp @@ -58,7 +58,7 @@ void Car::Rotate(qreal ang) } //r为弯道半径,ang为转过的角度 -void Car::turnLeft(int r, int ang) +void Car::turnLeft(int r, double ang) { qreal rad = qDegreesToRadians(ang); Forward(r*qSin(rad)); @@ -67,7 +67,7 @@ void Car::turnLeft(int r, int ang) } //r为弯道半径,ang为转过的角度 -void Car::turnRight(int r, int ang) +void Car::turnRight(int r, double ang) { qreal rad = qDegreesToRadians(ang); Forward(r*qSin(rad)); diff --git a/car.h b/car.h index 69c023a..3d09c0d 100644 --- a/car.h +++ b/car.h @@ -21,8 +21,8 @@ public: void moveLeft(qreal vel = 3); //向左平移 void moveRight(qreal vel = 3); //向右平移 void Rotate(qreal ang = 30); //原地旋转 - void turnLeft(int r, int ang); //左转 - void turnRight(int r, int ang); //右转 + void turnLeft(int r, double ang); //左转 + void turnRight(int r, double ang); //右转 Color getColor(); qreal getDir();