Skip to content

Instantly share code, notes, and snippets.

View eioo's full-sized avatar
👨‍💻
­onpas

Kalle eioo

👨‍💻
­onpas
  • Finland
View GitHub Profile
function angleCalculator(enemyPos : IPos, myPos : IPos) : IAngle {
const deltaX = myPos.x - enemyPos.x;
const deltaY = myPos.y - enemyPos.y;
const deltaZ = myPos.z - enemyPos.z;
const pitch = Math.atan2( deltaY, deltaZ );
let yaw;
if (deltaZ >= 0) {
yaw = -Math.atan2(deltaX * Math.cos(pitch), deltaZ);
@eioo
eioo / app.js
Last active January 25, 2018 14:47
Gulp + Express + Nodemon + Browser-sync in harmony
const express = require('express');
const app = express();
const router = express.Router();
app.use(express.static('public'));
app.listen(3000);