<commit_before>"use strict";
import UnitaryObject from './classes/unitaryobject.js';

import BezierCurve from './classes/beziercurve.js';
import Circle from './classes/circle.js';
import CircularSector from './classes/circularsector.js';
import Doughnut from './classes/doughnut.js';
import Graph from './classes/graph.js';
import Group from './classes/group.js';
import Image_ from './classes/image.js';
import Line from './classes/line.js';
import Point from './classes/point.js';
import Polygon from './classes/polygon.js';
import Quadrilateral from './classes/quadrilateral.js';
import Rect from './classes/rect.js';
import Segment from './classes/segment.js';
import Text_ from './classes/text.js';
import Triangle from './classes/triangle.js';
import {BaseVector, Vector, Vector3D} from './classes/vector.js';
import {version} from '../package.json';

const distance = (A, B) => {
    let res;
    if (A instanceof Point && B instanceof Point) {
        return Math.sqrt((A.x - B.x) * (A.x - B.x) + (A.y - B.y) * (A.y - B.y));
    }
    if (A instanceof Point && B instanceof Line) {
        res = B.a * A.x + B.b * A.y + B.c;
        if (res < 0) {
            res *= -1;
        }
        res /= Math.sqrt(B.a * B.a + B.b * B.b);
        return res;
    }
    if (A instanceof Line && B instanceof Point) {
        return distance(B, A);
    }
}

export default {
    distance: distance,
    UnitaryObject: UnitaryObject,
    BaseVector: BaseVector,<commit_msg>export distance() directly and export ContouredObject.<commit_after>"use strict";
import UnitaryObject from './classes/unitaryobject.js';
import ContouredObject from './classes/contouredobject.js';

import BezierCurve from './classes/beziercurve.js';
import Circle from './classes/circle.js';
import CircularSector from './classes/circularsector.js';
import Doughnut from './classes/doughnut.js';
import Graph from './classes/graph.js';
import Group from './classes/group.js';
import Image_ from './classes/image.js';
import Line from './classes/line.js';
import Point from './classes/point.js';
import Polygon from './classes/polygon.js';
import Quadrilateral from './classes/quadrilateral.js';
import Rect from './classes/rect.js';
import Segment from './classes/segment.js';
import Text_ from './classes/text.js';
import Triangle from './classes/triangle.js';
import {BaseVector, Vector, Vector3D} from './classes/vector.js';
import {version} from '../package.json';

export default {
    distance: (A, B) => {
        let res;
        if (A instanceof Point && B instanceof Point) {
            return Math.sqrt((A.x - B.x) * (A.x - B.x) + (A.y - B.y) * (A.y - B.y));
        }
        if (A instanceof Point && B instanceof Line) {
            res = B.a * A.x + B.b * A.y + B.c;
            if (res < 0) {
                res *= -1;
            }
            res /= Math.sqrt(B.a * B.a + B.b * B.b);
            return res;
        }
        if (A instanceof Line && B instanceof Point) {
            return distance(B, A);
        }
    },
    UnitaryObject: UnitaryObject,
    ContouredObject: ContouredObject,
    BaseVector: BaseVector,
{'fraction_non_alphanumeric': 0.15574823378291586, 'fraction_numerical': 0.0019267822736030828, 'mean_word_length': 2.690758293838863, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7002921', 'n_tokens_mistral': 977, 'n_tokens_neox': 967, 'n_words': 289}