Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F95200334
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
Fri, Dec 13, 16:29
Size
756 B
Mime Type
text/x-c
Expires
Sun, Dec 15, 16:29 (2 d)
Engine
blob
Format
Raw Data
Handle
22930187
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