dcrg.geom.concave
Functions
dcrg.geom.concave.Hull
- dcrg.geom.concave.Hull(points, k)
CONCAVEHULL Summary of this function goes here The first step of the process is to find the first vertex of the polygon as the one with the lowest Y value. In the second step, the k points that are nearest to the current point are selected as candidates to be the next vertex of the polygon . In the third step, the k-nearest points of the current point are selected as candidates to be the next point of the polygon. In this case, the point that results in the largest right-hand turn, corresponding to the largest angle between the previous line segment and the candidate line segment, is selected. As before, point is now part of the polygon and will never be considered in the next steps. The process is repeated until the selected candidate is the first vertex. For the first vertex For the first vertex to be elected as a candidate, it must be inserted again into the data set after the first four points of the polygon are computed (before that, if the first point is selected as the best candidate, a triangle is computed). By the end of the process, the polygon is closed with the first and the last point being the same.
dcrg.geom.concave.arcThree
- dcrg.geom.concave.arcThree(prev, act, sel)
- ARCTHREE Summary of this function goes here
Get the arc between three points (always) measured clock-wise. the points prev,act,sel define points which are connected by vectors The arc between those vector is calculated in degrees. Input: prev(previousPoint): 1x2 act(actualPoint): 1x2 sel(selectedPoint): 1x2
Andreas Bernatzky 08.02.20
dcrg.geom.concave.calcDist
- dcrg.geom.concave.calcDist(PointX, PointY, PointVector)
- CALCDIST Summary of this function goes here
Calculate the distance between one Point and N-Amount of different points in PointVector
Input: PointX 1x1 PointY 1x1 PointVector nx2
Output: distances from PointXY to PointVector points
Andreas Bernatzky 08.02.20
dcrg.geom.concave.calcHdg
- dcrg.geom.concave.calcHdg(P1X, P1Y, P2X, P2Y)
- CALCHDG Summary of this function goes here
Calculate vectorheading between two points and normalize it. Input: P1X,P1Y,P2X,P2Y (1x2) Output: hdg 1x1
Andreas Bernatzky 08.02.2020
dcrg.geom.concave.checkIntersection
- dcrg.geom.concave.checkIntersection(p1, q1, p2, q2)
- CHECKINTERSECTION Summary of this function goes here
The main function that returns true if line segment ‘p1q1’
and ‘p2q2’ intersect.
https://www.geeksforgeeks.org/check-if-two-given-line-segments-intersect/ https://www.geeksforgeeks.org/check-if-two-given-line-segments-intersect/ Input: p1,q1,p2,q2: 1x2 Output: boolean doIntersect (do the lines intersect true or false?) Andreas Bernatzky 08.02.2020
dcrg.geom.concave.knearest
- dcrg.geom.concave.knearest(distVec, k)
- GETKNEAREST Summary of this function goes here
get the amount k nearest neighbours. Or get the amout k shortest distances. Input: distVec nx2 k 1x1 Output: nxk´
Andreas Bernatzky 09.02.2020
dcrg.geom.concave.onSegment
- dcrg.geom.concave.onSegment(p, q, r)
ONSEGMENT Summary of this function goes here Given three colinear points p, q, r, the function checks if point q lies on line segment ‘pr’ Input: p,q,r (1x2) Output: boolean onSeg Andreas Bernatzky 08.02.2020
dcrg.geom.concave.orientation
- dcrg.geom.concave.orientation(p, q, r)
- To find orientation of ordered point triplet (p,q,r).
The function returns following values 0 –> a, b and c are colinear 1 –> Clockwise 2 –> Counterclockwise Input: p,q,r (1x2) Output: see function description
Andreas Bernatzky 08.02.2020
dcrg.geom.concave.setVec
- dcrg.geom.concave.setVec(vector, xVal, yVal)
- SETTOVECTOR Summary of this function goes here
Align to xy-value to Vector Input: vector: nx2 xVal,yVal: 1x1 Output: n+1 x 2
Andreas Bernatzky 09.02.2020