46 Sinusoid::Sinusoid(
double offset,
double amplitude,
double frequency,
double phase):
48 amplitude_(amplitude),
49 frequency_(frequency),
57 attr = ti_xml_element->Attribute(
"offset");
58 offset_ = attr ? atof(attr) : 0.0;
59 attr = ti_xml_element->Attribute(
"amplitude");
61 attr = ti_xml_element->Attribute(
"frequency");
63 attr = ti_xml_element->Attribute(
"phase");
64 phase_ = attr ? atof(attr) : 0.0;
78 double angular_frequency = 2.0*M_PI*
frequency_;
79 double p =
phase_ + angular_frequency*time;
80 double sin_p = sin(p);
81 double cos_p = cos(p);
84 qdd = -angular_frequency*angular_frequency*
amplitude_*sin_p;