Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F95157431
pendsphere.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, 07:55
Size
666 B
Mime Type
text/x-c
Expires
Sun, Dec 15, 07:55 (1 d, 23 h)
Engine
blob
Format
Raw Data
Handle
22915728
Attached To
rSYMKIT symkit
pendsphere.cpp
View Options
#include "pendsphere.h"
#include "penduledesc.h"
PendSphere::PendSphere( int id,
const PenduleDesc *desc,
GLModel *model,
const QString &label, specs_t flags)
: Shape(model, label, flags), id(id), desc(desc)
{
}
#include <cmath>
SVector<3> PendSphere::position() const
{
SVector<3> out;
double angle = desc->getAngle(0);
double l = desc->getLength(0);
out += {sin(angle) * l, - cos(angle) * l, 0};
if (id > 0)
{
angle = desc->getAngle(1);
l = desc->getLength(1);
out += {sin(angle) * l, - cos(angle) * l, 0};
}
return out;
}
Event Timeline
Log In to Comment