Changeset 336 in flairsrc for trunk/lib/FlairFilter/src/TrajectoryGenerator2DCircle_impl.cpp
 Timestamp:
 10/08/19 16:41:35 (5 years ago)
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

trunk/lib/FlairFilter/src/TrajectoryGenerator2DCircle_impl.cpp
r318 r336 72 72 73 73 // configure trajectory 74 angle_off = atan2 (start_pos.y  pos_off.y, start_pos.x  pos_off.x);74 angle_off = atan2f(start_pos.y  pos_off.y, start_pos.x  pos_off.x); 75 75 CurrentTime = 0; 76 76 } … … 120 120 if (CurrentTime < V / A) { 121 121 theta = angle_off + A / 2 * CurrentTime * CurrentTime / R; 122 pos.x = R * cos (theta);123 pos.y = R * sin (theta);124 v.x = A * CurrentTime * sin (theta);125 v.y = A * CurrentTime * cos (theta);122 pos.x = R * cosf(theta); 123 pos.y = R * sinf(theta); 124 v.x = A * CurrentTime * sinf(theta); 125 v.y = A * CurrentTime * cosf(theta); 126 126 } else { 127 127 if (!is_finishing) { 128 128 theta = 129 129 angle_off + V * V / (2 * A * R) + (CurrentTime  V / A) * V / R; 130 pos.x = R * cos (theta);131 pos.y = R * sin (theta);132 v.x = V * sin (theta);133 v.y = V * cos (theta);130 pos.x = R * cosf(theta); 131 pos.y = R * sinf(theta); 132 v.x = V * sinf(theta); 133 v.y = V * cosf(theta); 134 134 } else { 135 135 theta = angle_off + V * V / (2 * A * R) + … … 138 138 (FinishTime  CurrentTime) / R + 139 139 V * (CurrentTime  FinishTime) / R; 140 pos.x = R * cos (theta);141 pos.y = R * sin (theta);142 v.x = (V + A * (FinishTime  CurrentTime)) * sin (theta);143 v.y = (V + A * (FinishTime  CurrentTime)) * cos (theta);140 pos.x = R * cosf(theta); 141 pos.y = R * sinf(theta); 142 v.x = (V + A * (FinishTime  CurrentTime)) * sinf(theta); 143 v.y = (V + A * (FinishTime  CurrentTime)) * cosf(theta); 144 144 } 145 145 }
Note:
See TracChangeset
for help on using the changeset viewer.