0

I'm writing a program in C# that will allow me to take in my current heading, my current location, and the next two points I want to come across along my path and I want to output the angle at which I should currently be turning to follow an arc that will allow me to go to the next two points in my path.

Is there a library that will let me do this? Also, I've done a little research, and it looks like something called B-Spline might be useful, but I've no idea how to implement it. Is there a library for that? Also, it appears that Bsplining requires 4 points, and disregards current heading, so that might be an issue.

CamelopardalisRex
  • 353
  • 1
  • 2
  • 16

2 Answers2

0

You can do B-Spline interpolation with derivative constraints for the current heading. You only need at least two points for interpolation. I'm not sure if there is a C# library for that, but you can find whatever is out there on Google.

I do know that algorithms for doing this are made accessible in The NURBS Book, which one could easily implement in C#.

Jeff
  • 1,251
  • 1
  • 12
  • 22
0

There are several methods for B-Spline interpolation, such as adaptive,uniform. There is a javascript demo for it. http://wangweiqiang.net/lib/b-spline/