@flatten-js/core
Advanced tools
Comparing version 1.0.17 to 1.0.18
@@ -0,0 +0,0 @@ { |
@@ -0,0 +0,0 @@ # Example: flatten-js in a browser |
@@ -0,0 +0,0 @@ { |
@@ -0,0 +0,0 @@ # Example: flatten-js in React environment |
@@ -0,0 +0,0 @@ import React, {Component} from 'react'; |
@@ -0,0 +0,0 @@ import React from 'react'; |
@@ -0,0 +0,0 @@ # Example: flatten-js in a browser as es6 module |
@@ -0,0 +0,0 @@ // Just hit "node index.js" in the terminal while you are in the directory of this project |
@@ -0,0 +0,0 @@ // Type definitions for flatten-js library |
@@ -0,0 +0,0 @@ /** |
{ | ||
"name": "@flatten-js/core", | ||
"version": "1.0.17", | ||
"version": "1.0.18", | ||
"description": "Javascript library for 2d geometry", | ||
@@ -5,0 +5,0 @@ "main": "dist/main.cjs.js", |
@@ -0,0 +0,0 @@ /** |
import * as Utils from "../../src/utils/utils"; | ||
export default Utils; |
@@ -0,0 +0,0 @@ { |
@@ -0,0 +0,0 @@ import resolve from 'rollup-plugin-node-resolve'; |
@@ -0,0 +0,0 @@ [![npm version](https://badge.fury.io/js/%40flatten-js%2Fcore.svg)](https://badge.fury.io/js/%40flatten-js%2Fcore) |
@@ -0,0 +0,0 @@ ## Version Flatten v1.0 roadmap |
@@ -0,0 +0,0 @@ import resolve from 'rollup-plugin-node-resolve'; |
@@ -0,0 +0,0 @@ /** |
@@ -0,0 +0,0 @@ "use strict"; |
@@ -17,3 +17,3 @@ /** | ||
/* Crammer rule */ | ||
/* Cramer's rule */ | ||
let det = A1 * B2 - B1 * A2; | ||
@@ -24,5 +24,28 @@ let detX = C1 * B2 - B1 * C2; | ||
if (!Flatten.Utils.EQ_0(det)) { | ||
let new_ip = new Flatten.Point(detX / det, detY / det); | ||
ip.push(new_ip); | ||
let x, y; | ||
if (B1 === 0) { // vertical line x = C1/A1, where A1 == +1 or -1 | ||
x = C1/A1; | ||
y = detY / det; | ||
} | ||
else if (B2 === 0) { // vertical line x = C2/A2, where A2 = +1 or -1 | ||
x = C2/A2; | ||
y = detY / det; | ||
} | ||
else if (A1 === 0) { // horizontal line y = C1/B1, where B1 = +1 or -1 | ||
x = detX / det; | ||
y = C1/B1; | ||
} | ||
else if (A2 === 0) { // horizontal line y = C2/B2, where B2 = +1 or -1 | ||
x = detX / det; | ||
y = C2/B2; | ||
} | ||
else { | ||
x = detX / det; | ||
y = detY / det; | ||
} | ||
ip.push(new Flatten.Point(x, y)); | ||
} | ||
return ip; | ||
@@ -29,0 +52,0 @@ } |
@@ -0,0 +0,0 @@ /** |
@@ -0,0 +0,0 @@ |
@@ -0,0 +0,0 @@ /** |
@@ -0,0 +0,0 @@ /** |
@@ -0,0 +0,0 @@ /** |
@@ -0,0 +0,0 @@ /** |
@@ -0,0 +0,0 @@ /** |
@@ -0,0 +0,0 @@ /** |
@@ -0,0 +0,0 @@ "use strict"; |
@@ -0,0 +0,0 @@ /** |
@@ -0,0 +0,0 @@ /** |
@@ -0,0 +0,0 @@ "use strict"; |
@@ -0,0 +0,0 @@ /** |
@@ -0,0 +0,0 @@ /** |
@@ -0,0 +0,0 @@ import LinkedList from './linked_list'; |
@@ -0,0 +0,0 @@ /** |
@@ -0,0 +0,0 @@ /** |
@@ -0,0 +0,0 @@ import * as Constants from './utils/constants'; |
@@ -0,0 +0,0 @@ /** |
@@ -0,0 +0,0 @@ /** |
@@ -0,0 +0,0 @@ /** |
@@ -0,0 +0,0 @@ 'use strict'; |
@@ -0,0 +0,0 @@ |
@@ -0,0 +0,0 @@ /** |
@@ -0,0 +0,0 @@ 'use strict'; |
@@ -0,0 +0,0 @@ /** |
@@ -0,0 +0,0 @@ /** |
@@ -0,0 +0,0 @@ import { expect } from 'chai'; |
@@ -0,0 +0,0 @@ /** |
@@ -0,0 +0,0 @@ /** |
@@ -0,0 +0,0 @@ 'use strict'; |
@@ -0,0 +0,0 @@ 'use strict'; |
@@ -0,0 +0,0 @@ /** |
@@ -0,0 +0,0 @@ /** |
@@ -0,0 +0,0 @@ /** |
@@ -0,0 +0,0 @@ 'use strict'; |
@@ -0,0 +0,0 @@ /** |
@@ -0,0 +0,0 @@ /** |
@@ -0,0 +0,0 @@ /** |
@@ -0,0 +0,0 @@ /** |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
24303
3905416