Click here to Skip to main content
11,430,109 members (75,161 online)

Algorithms

 
JokeRe: How to determine the next x,y coordinate for a tank in a 2-D game... Pin
CPallini18-Jun-08 22:19
mvpCPallini18-Jun-08 22:19 
QuestionPolyline offset algorithm Pin
beko16-Jun-08 22:59
memberbeko16-Jun-08 22:59 
AnswerRe: Polyline offset algorithm Pin
Alan Balkany17-Jun-08 5:07
memberAlan Balkany17-Jun-08 5:07 
GeneralRe: Polyline offset algorithm Pin
beko17-Jun-08 5:43
memberbeko17-Jun-08 5:43 
QuestionRe: Polyline offset algorithm Pin
CPallini17-Jun-08 8:03
mvp CPallini17-Jun-08 8:03 
AnswerRe: Polyline offset algorithm Pin
beko17-Jun-08 9:26
memberbeko17-Jun-08 9:26 
GeneralRe: Polyline offset algorithm Pin
cp987617-Jun-08 13:10
membercp987617-Jun-08 13:10 
AnswerRe: Polyline offset algorithm Pin
Arash Partow18-Jun-08 2:22
memberArash Partow18-Jun-08 2:22 
There is no simple solution to this problem, the best known general solution, is to create capsules between consecutive point pairs of your polyline where the capsule width is the offset, then union the capsule outlines. The capsule may be centered around the edge or it may be biased towards one side of the edge it is really up to the end requirement. For the union operation use something like Alan Murta's Generic Polygon Clipper library.

If you know your polyline is enclosed and represents a convex polygon, then simply calculate the centroid, then offset each edge by the product of the desired offset amount and the vector composed of the mid-point of the edge at hand minus the centroid.

A simple example can be found here:
http://www.codeproject.com/KB/recipes/Wykobi.aspx
GeneralRe: Polyline offset algorithm Pin
beko18-Jun-08 20:55
memberbeko18-Jun-08 20:55 
QuestionWhat's the period of (cos ax)(sin bx)? Pin
sherifffruitfly14-Jun-08 11:00
membersherifffruitfly14-Jun-08 11:00 
AnswerRe: What's the period of (cos ax)(sin bx)? Pin
cp987614-Jun-08 20:03
membercp987614-Jun-08 20:03 
AnswerRe: What's the period of (cos ax)(sin bx)? Pin
MarkBrock15-Jun-08 3:00
memberMarkBrock15-Jun-08 3:00 
AnswerRe: What's the period of (cos ax)(sin bx)? Pin
CPallini15-Jun-08 23:02
mvp CPallini15-Jun-08 23:02 
QuestionQuaternion to Euler Pin
Xmen 11-Jun-08 4:08
member Xmen 11-Jun-08 4:08 
AnswerRe: Quaternion to Euler Pin
cmk11-Jun-08 12:27
membercmk11-Jun-08 12:27 
GeneralRe: Quaternion to Euler Pin
Xmen 11-Jun-08 13:48
member Xmen 11-Jun-08 13:48 
AnswerRe: Quaternion to Euler Pin
Mark Churchill12-Jun-08 19:38
memberMark Churchill12-Jun-08 19:38 
QuestionGraphical Object drawing algorithms Pin
Monty29-Jun-08 3:59
memberMonty29-Jun-08 3:59 
AnswerRe: Graphical Object drawing algorithms Pin
73Zeppelin9-Jun-08 4:11
member 73Zeppelin9-Jun-08 4:11 
GeneralRe: Graphical Object drawing algorithms Pin
Monty29-Jun-08 4:24
memberMonty29-Jun-08 4:24 
GeneralRe: Graphical Object drawing algorithms Pin
73Zeppelin9-Jun-08 4:37
member 73Zeppelin9-Jun-08 4:37 
GeneralRe: Graphical Object drawing algorithms Pin
Tim Craig9-Jun-08 18:37
memberTim Craig9-Jun-08 18:37 
GeneralRe: Graphical Object drawing algorithms Pin
Monty29-Jun-08 22:02
memberMonty29-Jun-08 22:02 
GeneralRe: Graphical Object drawing algorithms Pin
Tim Craig9-Jun-08 22:15
memberTim Craig9-Jun-08 22:15 
GeneralRe: Graphical Object drawing algorithms Pin
Monty29-Jun-08 23:17
memberMonty29-Jun-08 23:17 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.


Advertise | Privacy | Mobile
Web03 | 2.8.150428.2 | Last Updated 26 Apr 2015
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid