Click here to Skip to main content
15,887,027 members
Home / Discussions / Algorithms
   

Algorithms

 
JokeRe: How to determine the next x,y coordinate for a tank in a 2-D game... Pin
CPallini18-Jun-08 21:19
mveCPallini18-Jun-08 21:19 
QuestionPolyline offset algorithm Pin
beko16-Jun-08 21:59
beko16-Jun-08 21:59 
AnswerRe: Polyline offset algorithm Pin
Alan Balkany17-Jun-08 4:07
Alan Balkany17-Jun-08 4:07 
GeneralRe: Polyline offset algorithm Pin
beko17-Jun-08 4:43
beko17-Jun-08 4:43 
QuestionRe: Polyline offset algorithm Pin
CPallini17-Jun-08 7:03
mveCPallini17-Jun-08 7:03 
AnswerRe: Polyline offset algorithm Pin
beko17-Jun-08 8:26
beko17-Jun-08 8:26 
GeneralRe: Polyline offset algorithm Pin
cp987617-Jun-08 12:10
cp987617-Jun-08 12:10 
AnswerRe: Polyline offset algorithm Pin
Arash Partow18-Jun-08 1:22
Arash Partow18-Jun-08 1: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 19:55
beko18-Jun-08 19:55 
QuestionWhat's the period of (cos ax)(sin bx)? Pin
sherifffruitfly14-Jun-08 10:00
sherifffruitfly14-Jun-08 10:00 
AnswerRe: What's the period of (cos ax)(sin bx)? Pin
cp987614-Jun-08 19:03
cp987614-Jun-08 19:03 
AnswerRe: What's the period of (cos ax)(sin bx)? Pin
MarkB77715-Jun-08 2:00
MarkB77715-Jun-08 2:00 
AnswerRe: What's the period of (cos ax)(sin bx)? Pin
CPallini15-Jun-08 22:02
mveCPallini15-Jun-08 22:02 
QuestionQuaternion to Euler Pin
Xmen Real 11-Jun-08 3:08
professional Xmen Real 11-Jun-08 3:08 
AnswerRe: Quaternion to Euler Pin
cmk11-Jun-08 11:27
cmk11-Jun-08 11:27 
GeneralRe: Quaternion to Euler Pin
Xmen Real 11-Jun-08 12:48
professional Xmen Real 11-Jun-08 12:48 
AnswerRe: Quaternion to Euler Pin
Mark Churchill12-Jun-08 18:38
Mark Churchill12-Jun-08 18:38 
QuestionGraphical Object drawing algorithms Pin
Monty29-Jun-08 2:59
Monty29-Jun-08 2:59 
AnswerRe: Graphical Object drawing algorithms Pin
73Zeppelin9-Jun-08 3:11
73Zeppelin9-Jun-08 3:11 
GeneralRe: Graphical Object drawing algorithms Pin
Monty29-Jun-08 3:24
Monty29-Jun-08 3:24 
GeneralRe: Graphical Object drawing algorithms Pin
73Zeppelin9-Jun-08 3:37
73Zeppelin9-Jun-08 3:37 
GeneralRe: Graphical Object drawing algorithms Pin
Tim Craig9-Jun-08 17:37
Tim Craig9-Jun-08 17:37 
GeneralRe: Graphical Object drawing algorithms Pin
Monty29-Jun-08 21:02
Monty29-Jun-08 21:02 
GeneralRe: Graphical Object drawing algorithms Pin
Tim Craig9-Jun-08 21:15
Tim Craig9-Jun-08 21:15 
GeneralRe: Graphical Object drawing algorithms Pin
Monty29-Jun-08 22:17
Monty29-Jun-08 22:17 

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

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