Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F94112435
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
Wed, Dec 4, 00:33
Size
666 B
Mime Type
text/x-c
Expires
Fri, Dec 6, 00:33 (2 d)
Engine
blob
Format
Raw Data
Handle
22738369
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