This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// See if pt is between pt0 and pt1. | |
// via stackoverflow https://stackoverflow.com/a/328122 | |
auto is_between = [](VertexType pt, VertexType p0, VertexType p1) { | |
auto z = (pt.y - p0.y) * (p1.x - p0.x) | |
- (pt.x - p0.x) * (p1.y - p0.y); | |
if (abs(z) > .0001) return false; | |
auto d = (pt.x - p0.x) * (p1.x - p0.x) | |
+ (pt.y - p0.y) * (p1.y - p0.y); | |
if (d < 0) return false; | |
auto n2 = (p1.x - p0.x) * (p1.x - p0.x) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Drawing; | |
using System.Windows.Forms; | |
namespace WinFormsApp1 | |
{ | |
public partial class Form1 : Form | |
{ | |
public Form1() | |
{ |
OlderNewer