5 double BicycleCar::lfx()
7 double lfx = this->x();
8 lfx += (this->w() / 2) * cos(this->h() + M_PI / 2);
9 lfx += this->df() * cos(this->h());
10 lfx += this->sd() * cos(this->h());
14 double BicycleCar::lfy()
16 double lfy = this->y();
17 lfy += (this->w() / 2) * sin(this->h() + M_PI / 2);
18 lfy += this->df() * sin(this->h());
19 lfy += this->sd() * sin(this->h());
23 double BicycleCar::lrx()
25 double lrx = this->x();
26 lrx += (this->w() / 2) * cos(this->h() + M_PI / 2);
27 lrx += -this->dr() * cos(this->h());
28 lrx += -this->sd() * cos(this->h());
32 double BicycleCar::lry()
34 double lry = this->y();
35 lry += (this->w() / 2) * sin(this->h() + M_PI / 2);
36 lry += -this->dr() * sin(this->h());
37 lry += -this->sd() * sin(this->h());
41 double BicycleCar::rrx()
43 double rrx = this->x();
44 rrx += (this->w() / 2) * cos(this->h() - M_PI / 2);
45 rrx += -this->dr() * cos(this->h());
46 rrx += -this->sd() * cos(this->h());
50 double BicycleCar::rry()
52 double rry = this->y();
53 rry += (this->w() / 2) * sin(this->h() - M_PI / 2);
54 rry += -this->dr() * sin(this->h());
55 rry += -this->sd() * sin(this->h());
59 double BicycleCar::rfx()
61 double rfx = this->x();
62 rfx += (this->w() / 2) * cos(this->h() - M_PI / 2);
63 rfx += this->df() * cos(this->h());
64 rfx += this->sd() * cos(this->h());
68 double BicycleCar::rfy()
70 double rfy = this->y();
71 rfy += (this->w() / 2) * sin(this->h() - M_PI / 2);
72 rfy += this->df() * sin(this->h());
73 rfy += this->sd() * sin(this->h());
77 double BicycleCar::ralx()
79 double lrx = this->x();
80 lrx += (this->w() / 2) * cos(this->h() + M_PI / 2);
83 double BicycleCar::raly()
85 double lry = this->y();
86 lry += (this->w() / 2) * sin(this->h() + M_PI / 2);
90 double BicycleCar::rarx()
92 double rrx = this->x();
93 rrx += (this->w() / 2) * cos(this->h() - M_PI / 2);
97 double BicycleCar::rary()
99 double rry = this->y();
100 rry += (this->w() / 2) * sin(this->h() - M_PI / 2);
104 BicycleCar *BicycleCar::ccl()
106 BicycleCar *bc = new BicycleCar();
107 bc->x(this->x() + this->mtr() * cos(this->h() + M_PI / 2));
108 bc->y(this->y() + this->mtr() * sin(this->h() + M_PI / 2));
113 BicycleCar *BicycleCar::ccr()
115 BicycleCar *bc = new BicycleCar();
116 bc->x(this->x() + this->mtr() * cos(this->h() - M_PI / 2));
117 bc->y(this->y() + this->mtr() * sin(this->h() - M_PI / 2));
123 void BicycleCar::next()
125 if (this->st() > this->wb() / this->mtr())
126 this->st(this->wb() / this->mtr());
127 if (this->st() < -this->wb() / this->mtr())
128 this->st(-this->wb() / this->mtr());
129 this->h(this->h() + this->sp() / this->wb() * tan(this->st()));
130 this->x(this->x() + this->sp() * cos(this->h()));
131 this->y(this->y() + this->sp() * sin(this->h()));
134 BicycleCar::BicycleCar()