Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F120774430
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
Sun, Jul 6, 23:32
Size
756 B
Mime Type
text/x-c
Expires
Tue, Jul 8, 23:32 (2 d)
Engine
blob
Format
Raw Data
Handle
27246899
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