position_uniform
position of an object moving uniformly
You're viewing an older version of this page (#480). View the current version.
Interface
#include <codecogs/physics/kinematics/position_uniform.h>
using namespace Physics::Kinematics;
Overview
This module computes the position of an object moving uniformly (constant speed or constant acceleration).
FUNCTION
position_const_velocity
This function determines the position of an object at time
after moving uniformly at constant velocity
for a certain period of time. The formula relating the above quantities is
where is the initial position of the object at time
.
Example 1
#include <codecogs/physics/kinematics/position_uniform.h>
#include <iostream>
int main()
{
// the constant velocity and the current time
double v = 5.7, t = 12;
std::cout << std::endl;
std::cout << "Velocity = " << v << " m/s";
std::cout << std::endl;
std::cout << " Time = " << t << " s";
std::cout << std::endl << std::endl;
// compute the current position
// assuming the initial position and time are null
std::cout << "Position = " <<
Physics::Kinematics::position_const_velocity(t, v);
std::cout << " m" << std::endl;
return 0;
}Output
Velocity = 5.7 m/s
Time = 12 s
Position = 68.4 mParameters
Returns
Interactive Calculator
Computing…
Set a range above first to export a graph.
FUNCTION
position_const_acceleration
This function determines the position of an object at time
after moving uniformly at constant acceleration
for a certain period of time, with initial velocity given by
. The formula relating the above quantities is
where is the initial position of the object at time
.
Example 1
#include <codecogs/physics/kinematics/position_uniform.h>
#include <iostream>
int main()
{
// the constant velocity and the current time
double a = 0.7, v0 = 4.33, t = 9.8;
std::cout << std::endl;
std::cout << " Acceleration = " << a << " m/s^2";
std::cout << std::endl;
std::cout << "Init. velocity = " << v0 << " m/s";
std::cout << std::endl;
std::cout << " Time = " << t << " s";
std::cout << std::endl << std::endl;
// compute the current position
// assuming the initial position and time are null
std::cout << " Position = " <<
Physics::Kinematics::position_const_acceleration(t, a, v0);
std::cout << " m" << std::endl;
return 0;
}Output
Acceleration = 0.7 m/s^2
Init. velocity = 4.33 m/s
Time = 9.8 s
Position = 76.048 mParameters
Returns
Interactive Calculator
Computing…
Set a range above first to export a graph.