Skip to content

Commit

Permalink
Addes setters for SineSeries parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
Bernie Jenny committed Apr 23, 2017
1 parent 1956e7a commit 787bffb
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions CanvasMap/src/projections/SineSeries.js
@@ -1,19 +1,32 @@
function SineSeries(p, q) {
"use strict";

var k = q / p;
if (arguments.length < 2) {
p = 1.33;
q = 1.135;
}

var k = q / p;

this.toString = function () {
return 'Sine Series';
};

this.setP = function (newP) {
p = parseFloat(newP);
k = q / p;
};

this.setQ = function (newQ) {
q = parseFloat(newQ);
k = q / p;
};

this.forward = function (lon, lat, xy) {
var x = k * lon * Math.cos(lat);
lat /= q;
xy[0] = x / Math.cos(lat);
xy[1] = p * Math.sin(lat);

};

this.inverse = function (x, y, lonlat) {
Expand Down

0 comments on commit 787bffb

Please sign in to comment.