Points, lines, angles, and offsets

If you have a cool piece of software to share, but you are not hosting it officially yet, please dump it in here. If you have code snippets that are useful, please donate!
Earned some good credits
Earned some good credits
Posts: 107
Joined: Fri Nov 27, 2009 2:49 am

Points, lines, angles, and offsets

Postby beneficii » Sun Aug 10, 2014 3:13 am

Got something working. In point.h, static angle() method returns the unit circle angle (from 0 degrees to approaching 360 degrees), which can then be used to find the offset of the point at the given angle, setting off perpendicularly from the given angle. The offset() method uses the unit circle angle to find the offset.

I create a wxWidgets window to test this out. It tests that the correct offset was made by taking the distance from the new points to the old points.

The files attached should be addable to any wxWidgets 3.0 project.
(9.76 KiB) Downloaded 90 times

Return to “The Code Dump”

Who is online

Users browsing this forum: No registered users and 1 guest