{Skin/Usermenu.htmlload}
Beverly Hills Real Estate

Main Content

Moving From To Florida


   (Go Back) Choose State To Move From ') {
var r = data[0];
var g = data[1];
var b = data[2];
var a = data[3];
this.r = r / 255;
this.g = g / 255;
this.b = b / 255;
this.a = a;
}
}
return Color;
})();
var Vector = (function () {
function Vector(x, y) {
if (typeof x === 'undefined') {
this.x = 0;
this.y = 0;
}
else if (typeof y === 'undefined') {
this.x = x;
this.y = x;
}
else {
this.x = x;
this.y = y;
}
}
Vector.prototype.add = function (v) {
this.x += v.x;
this.y += v.y;
return this;
};
Vector.prototype.sub = function (v) {
this.x -= v.x;
this.y -= v.y;
return this;
};
Vector.prototype.dot = function (v) {
return this.x * v.x + this.y * v.y;
};
Vector.prototype.mult = function (n) {
this.x *= n;
this.y *= n;
return this;
};
Vector.prototype.norm = function () {
var m = this.mag();
if (m != 0) {
this.mult(1 / m);
}
return this;
};
Vector.prototype.mag = function () {
return Math.sqrt(this.x * this.x + this.y * this.y);
};
Vector.prototype.limit = function (max) {
var m = this.mag();
if (m > max) {
this.mult(max / m);
}
return this;
};
Vector.prototype.angle = function () {
return Math.atan2(this.y, this.x);
};
Vector.prototype.angleBetween = function (v) {
return Math.acos(this.dot(v) / (this.mag() * v.mag()));
};
Vector.prototype.setAngle = function (a) {
var m = this.mag();
this.x = m * Math.cos(a);
this.y = m * Math.sin(a);
return this;
};
Vector.prototype.rotate = function (a) {
var newAngle = this.angle() + a;
var m = this.mag();
this.x = m * Math.cos(newAngle);
this.y = m * Math.sin(newAngle);
return this;
};
Vector.prototype.clone = function () {
return new Vector(this.x, this.y);
};
Vector.prototype.equals = function (v) {
return this.x == v.x && this.y == v.y;
};
return Vector;
})();
var Particle = (function () {
function Particle(x, y, m) {
this.pos = new Vector(x, y);
this.vel = new Vector();
this.acc = new Vector();
this.mass = m;
this.r = Math.sqrt(m) / 2;
this.lifespan = 1;
this.lifeReduction = 0.01;
this.color = new Color(255);
}
Particle.prototype.applyForce = function (force) {
force.div(this.mass);
this.acc.add(force);
};
Particle.prototype.update = function () {
this.vel.add(this.acc);
this.pos.add(this.vel);
this.acc.mult(0);
this.lifespan -= this.lifeReduction;
};
Particle.prototype.display = function (ctx) {
ctx.fillStyle = this.color.toRGBA(this.lifespan);
ctx.beginPath();
ctx.arc(this.pos.x, this.pos.y, this.r, 0, Math.PI * 2, true);
ctx.closePath();
ctx.fill();
};
Particle.prototype.isDead = function () {
return this.lifespan < 0;
};
return Particle;
})();
var ParticleSystem = (function () {
function ParticleSystem(x, y) {
this.origin = new Vector(x, y);
this.particles = [];
}
ParticleSystem.prototype.addParticle = function (p) {
this.particles.push(p);
};
ParticleSystem.prototype.applyRepeller = function (r) {
for (var i = 0; i < this.particles.length; i++) {
var p = this.particles[i];
var force = r.repel(p);
p.applyForce(force);
}
};
ParticleSystem.prototype.run = function () {
for (var i = this.particles.length - 1; i >= 0; i--) {
var p = this.particles[i];
p.update();
if (p.isDead()) {
this.particles.splice(i, 1);
}
}
};
ParticleSystem.prototype.display = function (ctx) {
for (var i = 0; i < this.particles.length; i++) {
var p = this.particles[i];
p.display(ctx);
}
};
return ParticleSystem;
})();
var Repeller = (function () {
function Repeller(x, y) {
this.pos = new Vector(x, y);
this.r = 20;
this.strength = 100;
}
Repeller.prototype.display = function (ctx) {
ctx.fillStyle = '#F00';
ctx.beginPath();
ctx.arc(this.pos.x, this.pos.y, this.r, 0, Math.PI * 2, true);
ctx.closePath();
ctx.fill();
};
Repeller.prototype.repel = function (p) {
var dir = new Vector(this.pos.x - p.pos.x, this.pos.y - p.pos.y);
var d = dir.mag();
d = constrain(d, 5, 100);
dir.norm();
var force = -1 * this.strength / (d * d);
dir.mult(force);
return dir;
};
return Repeller;
})();
var system;
var repeller;
function init() {
var canvas = document.getElementById('canvas');
var ctx = canvas.getContext('2d');
canvas.width = window.innerWidth;
canvas.height = window.innerHeight;
system = new ParticleSystem(canvas.width / 2, canvas.height / 2);
repeller = new Repeller(canvas.width / 2, canvas.height / 2);
for (var i = 0; i < 100; i++) {
var p = new Particle(canvas.width / 2, 50, Math.random() * 10 + 1);
system.addParticle(p);
}
window.addEventListener('mousemove', function (e) {
repeller.pos.x = e.clientX;
repeller.pos.y = e.clientY;
});
window.addEventListener('click', function (e) {
var p = new Particle(e.clientX, e.clientY, Math.random() * 10 + 1);
system.addParticle(p);
});
window.requestAnimationFrame(draw);
}
function draw() {
var canvas = document.getElementById('canvas');
var ctx = canvas.getContext('2d');
ctx.clearRect(0, 0, canvas.width, canvas.height);
system.applyRepeller(repeller);
system.run();
repeller.display(ctx);
window.requestAnimationFrame(draw);
}
window.onload = init;
//# sourceMappingURL=app.js.map

Let's work together
Thank you for your interest in getting in touch with me. Please select the option that suits you the best and fill out the form: