compare-angle

WebJar for compare-angle

License

License

MIT
GroupId

GroupId

org.webjars.npm
ArtifactId

ArtifactId

compare-angle
Last Version

Last Version

1.0.1
Release Date

Release Date

Type

Type

jar
Description

Description

compare-angle
WebJar for compare-angle
Project URL

Project URL

http://webjars.org
Source Code Management

Source Code Management

https://github.com/mikolalysenko/compare-angle

Download compare-angle

How to add to project

<!-- https://jarcasting.com/artifacts/org.webjars.npm/compare-angle/ -->
<dependency>
    <groupId>org.webjars.npm</groupId>
    <artifactId>compare-angle</artifactId>
    <version>1.0.1</version>
</dependency>
// https://jarcasting.com/artifacts/org.webjars.npm/compare-angle/
implementation 'org.webjars.npm:compare-angle:1.0.1'
// https://jarcasting.com/artifacts/org.webjars.npm/compare-angle/
implementation ("org.webjars.npm:compare-angle:1.0.1")
'org.webjars.npm:compare-angle:jar:1.0.1'
<dependency org="org.webjars.npm" name="compare-angle" rev="1.0.1">
  <artifact name="compare-angle" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.webjars.npm', module='compare-angle', version='1.0.1')
)
libraryDependencies += "org.webjars.npm" % "compare-angle" % "1.0.1"
[org.webjars.npm/compare-angle "1.0.1"]

Dependencies

compile (5)

Group / Artifact Type Version
org.webjars.npm : two-sum jar [1.0.0,2)
org.webjars.npm : robust-orientation jar [1.0.2,2)
org.webjars.npm : robust-product jar [1.0.0,2)
org.webjars.npm : signum jar [0.0.0,0.0.1)
org.webjars.npm : robust-sum jar [1.0.0,2)

Project Modules

There are no modules declared in this project.

compare-angle

Let A, B, C and D be four points in the plan. Then of the pair of angles ABC and ABD, determine which is larger.

  C
  *      D
   \     *
    \ABC/
     \ / ABD
      *-------------*
      B             A

Example

var compareAngle = require("compare-angle")

var A = [2, 0]
var B = [0, 0]
var C = [-1, 2]
var D = [1, 1]

console.log(compareAngle(A, B, C, D),  compareAngle(A, B, D, C))

Output:

1   -1

Install

npm install compare-angle

API

require("compare-angle")(a, b, c, d)

Compares the angles ABC and ABD to determine which is greater.

  • a, b are the base points of the angle
  • c is the end of the first angle
  • d is the end of the second angle

Returns A number indicating which angle is larger

  • +1 if angle ABC is greater than angle ABD
  • 0 if the angles are equal
  • -1 if angle ABD is greater than angle ABC

Credits

(c) 2014 Mikola Lysenko. MIT License

Versions

Version
1.0.1