Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F103495018
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
Sun, Mar 2, 12:02
Size
666 B
Mime Type
text/x-c
Expires
Tue, Mar 4, 12:02 (2 d)
Engine
blob
Format
Raw Data
Handle
24594396
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