Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const getLength = (x) => round(x/36, 1);
const intersects = () => model.intersections(circles[0].val, circles[1].val);
const getLength = (x) => round(x/36, 1);
const intersects = () => model.intersections(circles[0].val, circles[1].val);
function update() {
const px = slider.position.x;
const x = round(MIN + (px / width) * (MAX - MIN), 1);
const y = round(F(x), 1);
const py = (y - MIN) / (MAX - MIN) * width;
$slider.text = x;
$output.text = y;
$output.css('left', py + 'px');
$output.css('display', (y < MIN || y > MAX) ? 'none' : 'block');
$connection.setAttr('d', `M ${px} 0 C ${px} 40, ${py} 20, ${py} 60`);
}
function makeTickmarks(min, max, major, minor, generate) {
for (let i = min; i <= max; i += minor) {
i = round(i, 3);
generate(i, nearlyEquals(i % major, 0));
}
}
const sqrtDistance = p => round(Math.sqrt(square(p.x) + square(17 - p.y)), 3);
$step.model.set('sqrtDistance', sqrtDistance);
$step.model.set('rad', (r: number) => {
const a = r / Math.PI;
return a > 1.99 ? 2 : round(a, 2);
});
$geopad.waitForPath(path => (round(path.val.r/36, 1) === 5 &&
path.points[0] === base.points.filter(p => p !== circle1.points[0])[0])),
(path) => {
function update() {
const px = slider.position.x;
const x = round(MIN + (px / width) * (MAX - MIN), 1);
const y = round(F(x), 1);
const py = (y - MIN) / (MAX - MIN) * width;
$slider.text = x;
$output.text = y;
$output.css('left', py + 'px');
$output.css('display', (y < MIN || y > MAX) ? 'none' : 'block');
$connection.setAttr('d', `M ${px} 0 C ${px} 40, ${py} 20, ${py} 60`);
}
$slider.on('move', (x) => {
for (let i = 0; i < COUNT; ++i) {
let t = i * Math.PI * 2 * x / $slider.steps;
let r = Math.sqrt(i) / Math.sqrt(COUNT) * 196;
$circles[i].setCenter({
x: 200 + r * Math.cos(t),
y: 200 + r * Math.sin(t)
});
}
$value.text = `${round(x / 1000 * 360, 1)}° (${x / 1000} rotations)`;
});