Select Page
Latest 0.1.0 https://github.com/srinija/SAGeometry MIT ios 8.0 UIKit

## Usage

These are the functions availabe right now:

#### Lines and Points:

``````distanceBetweenPoints(point1: CGPoint, point2: CGPoint) -> CGFloat
getAngleBetweenPoints(p1:CGPoint, p2: CGPoint, p3:CGPoint) -> Double
getAngleBetweenPointsInDegrees(p1:CGPoint, p2: CGPoint, p3:CGPoint) -> Double
arePointsCollinear(points:[CGPoint]) -> Bool
shortestDistanceBetweenLineAndPoint(point:CGPoint, l1:CGPoint, l2:CGPoint) -> CGFloat
isPointOnLine(point:CGPoint, l1:CGPoint, l2:CGPoint) -> Bool
doLineSegmentsIntersect(l1:CGPoint, l2:CGPoint, m1:CGPoint, m2:CGPoint) -> Bool``````

#### Qudrilaterals:

``````isQuadrilateral(points:[CGPoint])
getCGRectFromPoints(topLeft: CGPoint,topRight: CGPoint,bottomRight: CGPoint,bottomLeft: CGPoint) -> CGRect?
isConvex(corners:[CGPoint]) -> Bool
isConcave(corners:[CGPoint]) -> Bool

#### Circles:

``````isPointInsideCircle(point:CGPoint, center:CGPoint, radius:CGFloat) -> Bool

#### Polygons:

``````isPointOnPolygon(point:CGPoint, polygon:[CGPoint]) -> Bool
isPointInsidePolygon(point:CGPoint, polygon:[CGPoint]) -> Bool``````

More functions on the way!

## Example

To run the example project, clone the repo, and run `pod install` from the Example directory first.

Move the different points in the example around to see various functions being used.

## Installation

### CocoaPods

To install with CocoaPods, simply add the following line to your Podfile:

``pod 'SAGeometry'``

## Author

Srinija Ammapalli

### Latest podspec

```{
"name": "SAGeometry",
"version": "0.1.0",
"summary": "A geometry helper for core graphics written in swift.",
"homepage": "https://github.com/srinija/SAGeometry",
"type": "MIT",
},
"authors": "Srinija Ammapalli",
"source": {
"git": "https://github.com/srinija/SAGeometry.git",
"tag": "0.1.0"
},
"platforms": {
"ios": "8.0"
},
"source_files": "SAGeometry/Classes/**/*",
"frameworks": "UIKit",
"pushed_with_swift_version": "3.0"
}```