Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
N
node-drone
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
15김건우
node-drone
Commits
36d0422c
Commit
36d0422c
authored
Jun 08, 2019
by
16김민성
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Progress positioning system
parent
60b3c621
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
35 additions
and
14 deletions
+35
-14
possys.js
public/possys.js
+35
-14
No files found.
public/possys.js
View file @
36d0422c
...
...
@@ -3,19 +3,18 @@
* y = r * sin(theta) * sin(phi)
* z = r * cos(theta)
*/
/* Reverse conversion
* r = sqrt(x*x + y*y + z*z)
* theta = acos(z/r)
* phi = atan(y/x)
*/
/* A vector library written by 'evanw'; source: https://evanw.github.io/lightgl.js/docs/vector.html */
function
Vector
(
x
,
y
,
z
)
{
this
.
x
=
x
||
0
;
this
.
y
=
y
||
0
;
this
.
z
=
z
||
0
;
class
Vector
{
constructor
(
x
,
y
,
z
)
{
this
.
x
=
x
||
0
;
this
.
y
=
y
||
0
;
this
.
z
=
z
||
0
;
}
}
Vector
.
prototype
=
{
...
...
@@ -84,14 +83,36 @@ Vector.prototype = {
}
};
var
distHand
=
80
;
var
distDrone
=
500
;
var
origin
=
Vector
(
0
,
0
,
0
);
var
posHand
=
Vector
(
80
,
0
,
0
);
var
posDrone
=
Vector
(
500
,
0
,
0
);
class
UserInfo
{
constructor
()
{
this
.
pos
=
new
Vector
(
80
,
0
,
0
);
this
.
distHand
=
80
;
}
}
class
DroneInfo
{
constructor
()
{
this
.
distDrone
=
500
;
this
.
pos
=
new
Vector
(
500
,
0
,
0
);
// Current position of the drone. It is changed only if a real position of dron is changed.
this
.
pitch
=
0
;
this
.
roll
=
0
;
this
.
yow
=
0
;
}
}
class
DroneDest
{
constructor
()
{
this
.
distDrone
=
500
;
this
.
pos
=
new
Vector
(
500
,
0
,
0
);
}
}
function
handToDroneDelta
(
_nextHand
){
var
origin
=
new
Vector
(
0
,
0
,
0
);
function
handToDroneDelta
(
_nextHand
)
{
var
delta
=
_nextHand
-
origin
;
delta
=
delta
.
multiply
()
}
\ No newline at end of file
return
posDrone
.
add
(
delta
);
}
function
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment