Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F94257988
pendulersphere.cpp
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Thu, Dec 5, 05:12
Size
756 B
Mime Type
text/x-c
Expires
Sat, Dec 7, 05:12 (2 d)
Engine
blob
Format
Raw Data
Handle
22771551
Attached To
rSYMKIT symkit
pendulersphere.cpp
View Options
#include "pendulersphere.h"
#include "penduleressortdesc.h"
PendrSphere::PendrSphere(unsigned int id,
const PenduleRessort *desc,
GLModel *model,
const QString &label, specs_t flags)
: Shape(model, label, flags), id(id), desc(desc)
{
}
#include <cmath>
SVector<3> PendrSphere::position() const
{
SVector<3> out;
// position si ressort
double position = desc->getp()[0];
out += { position, 0, 0};
// position si pendule
if (isPendule())
{
double angle = desc->getp()[1];
double l = desc->getLenght();
out += {sin(angle) * l, - cos(angle) * l, 0};
}
return out;
}
bool PendrSphere::isPendule() const
{
return id > 0;
}
Event Timeline
Log In to Comment