enable eslint fix and eslint-plugin-jsdoc

This commit is contained in:
Matthieu MOREL
2021-11-08 22:06:24 +01:00
committed by Matthieu Morel
parent c29c8bd33c
commit 4d103c14f7
53 changed files with 3476 additions and 2715 deletions

View File

@@ -1,5 +1,10 @@
import intersectEllipse from './intersect-ellipse';
/**
* @param node
* @param rx
* @param point
*/
function intersectCircle(node, rx, point) {
return intersectEllipse(node, rx, rx, point);
}

View File

@@ -1,3 +1,9 @@
/**
* @param node
* @param rx
* @param ry
* @param point
*/
function intersectEllipse(node, rx, ry, point) {
// Formulae from: http://mathworld.wolfram.com/Ellipse-LineIntersection.html

View File

@@ -1,6 +1,12 @@
/*
/**
* Returns the point at which two lines, p and q, intersect or returns
* undefined if they do not intersect.
*
*
* @param p1
* @param p2
* @param q1
* @param q2
*/
function intersectLine(p1, p2, q1, q2) {
// Algorithm from J. Avro, (ed.) Graphics Gems, No 2, Morgan Kaufmann, 1994,
@@ -63,6 +69,10 @@ function intersectLine(p1, p2, q1, q2) {
return { x: x, y: y };
}
/**
* @param r1
* @param r2
*/
function sameSign(r1, r2) {
return r1 * r2 > 0;
}

View File

@@ -1,5 +1,9 @@
module.exports = intersectNode;
/**
* @param node
* @param point
*/
function intersectNode(node, point) {
// console.info('Intersect Node');
return node.intersect(point);

View File

@@ -4,9 +4,13 @@ import intersectLine from './intersect-line';
export default intersectPolygon;
/*
/**
* Returns the point ({x, y}) at which the point argument intersects with the
* node argument assuming that it has the shape specified by polygon.
*
* @param node
* @param polyPoints
* @param point
*/
function intersectPolygon(node, polyPoints, point) {
var x1 = node.x;