Skip to content

# 061375/Image-Manipulation

trig class

• Loading branch information...  Jeremy Heminger authored and Jeremy Heminger committed Apr 4, 2019
1 parent 23f24fe commit a1ccf09b4c1db5a6a5544ae7ebeca0c09c8a5cad
Showing with 37 additions and 36 deletions.
1. +1 −31 js/other.js
2. +36 −5 js/{geometry.js → trigonometry.js}
 @@ -48,35 +48,5 @@ export class Colors { * @class General * */ export class General { /** * * @function trig * @param {Number} * @param {Number} * @param {Number} * @param {Number} * @param {Boolean} * @returns {Mixed} * */ static trig(x,y,r,d,array=true) { if(d<0)d+=360; if(d>360)d-=360; let a = d * Math.PI / 180; let xpos = r * Math.cos(a); let ypos = r * Math.sin(a); if(array) { return [ ~~xpos+x, ~~ypos+y ] }else{ return { x:~~xpos+x, y:~~ypos+y } } } }
 @@ -5,10 +5,10 @@ import * as imagedata from '/js/imagedata.js' export default {} /** * @class Geometry * @extends Geometry * @class Trigonometry * @extends Trigonometry * */ export class Geometry extends ImageData { export class Trigonometry extends ImageData { constructor() { super() this.cids = 0 @@ -31,8 +31,8 @@ export class Geometry extends ImageData { let temp = this.buffer for(let j=0;j360)d-=360; let a = d * Math.PI / 180; let xpos = r * Math.cos(a); let ypos = r * Math.sin(a); if(array) { return [ ~~xpos+x, ~~ypos+y ] }else{ return { x:~~xpos+x, y:~~ypos+y } } } }

#### 0 comments on commit `a1ccf09`

Please sign in to comment.
You can’t perform that action at this time.