Commit 36d0422c authored by 16김민성's avatar 16김민성

Progress positioning system

parent 60b3c621
......@@ -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
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment