FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
PhysicsSimulationEngine/dev/src/Plot.js at master · explorablescience/PhysicsSimulationEngine · GitHub
Uh oh!
There was an error while loading.
Please reload this page
.
explorablescience
/
PhysicsSimulationEngine
Public
Notifications
You must be signed in to change notification settings
Fork
4
Star
26
Code
Issues
0
Pull requests
2
Actions
Wiki
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Actions
Wiki
Security and quality
Insights
Expand file tree
Breadcrumbs
PhysicsSimulationEngine
/
dev
/
src
/
Plot.js
Copy path
More file actions
More file actions
Latest commit
History
History
History
30 lines (24 loc) · 643 Bytes
Breadcrumbs
PhysicsSimulationEngine
/
dev
/
src
/
Plot.js
Copy path
File metadata and controls
30 lines (24 loc) · 643 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
class
Plot
{
constructor
(
)
{
this
.
vec
=
new
Vector
(
2
,
2
,
0
,
'red'
,
'test'
)
;
this
.
theta
=
0
;
}
update
(
dt
)
{
this
.
vec
.
x
=
2
*
Math
.
cos
(
this
.
theta
)
this
.
vec
.
y
=
2
*
Math
.
sin
(
this
.
theta
)
;
this
.
theta
+=
0.01
*
dt
*
100
;
}
draw
(
drawer
)
{
drawer
.
stroke
(
255
,
0
,
0
)
.
strokeWeight
(
3
)
.
rect
(
0
,
0
,
1
,
2
)
;
this
.
vec
.
draw
(
new
Vector
(
1
,
1
)
)
;
}
}
function
startRecord
(
)
{
_pSimulationInstance
.
recorder
.
start
(
)
;
// starts recording
}
function
stopRecord
(
)
{
_pSimulationInstance
.
recorder
.
stop
(
)
;
// stop recording and exports
}
Back
|
FazBrowse Home
|
New Git URL