Ignore:
Timestamp:
10/08/19 16:41:35 (5 years ago)
Author:
Sanahuja Guillaume
Message:

use float

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/lib/FlairFilter/src/TrajectoryGenerator2DCircle_impl.cpp

    r318 r336  
    7272
    7373  // 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);
    7575  CurrentTime = 0;
    7676}
     
    120120      if (CurrentTime < V / A) {
    121121        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);
    126126      } else {
    127127        if (!is_finishing) {
    128128          theta =
    129129              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);
    134134        } else {
    135135          theta = angle_off + V * V / (2 * A * R) +
     
    138138                      (FinishTime - CurrentTime) / R +
    139139                  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);
    144144        }
    145145      }
Note: See TracChangeset for help on using the changeset viewer.