# Get Spline curve angle for auto-banking

THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

On 11/11/2007 at 22:57, xxxxxxxx wrote:

User Information:
Cinema 4D Version:   10.1
Platform:   Windows  ;
Language(s) :     C++  ;

---------
Hi,

I want to implement auto-banking for objects that are aligned to a spline.

I tried the method I found on base80.com: Calculating the banking angle from the difference of current and last Rot.H value. But this causes problems when the value 'increases' from 359° to 0°.
It would be better to determine the 'curve angle' of the spline for a point on the spline. But how can do this?

Thanks for any tips & help!

Greetings,
Jack

THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

On 13/11/2007 at 02:42, xxxxxxxx wrote:

Nobody? No idea?

THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

On 13/11/2007 at 03:15, xxxxxxxx wrote:

Hi Jack.
AFAIK a "curve angle" from a point would be it's tangent but that would not be so reliable as a solid source.
As for the flipping of a full turn (359->0 and 0->359) you can calculate the
resulting minimum angle and use that Fortunately there is a function for it in the SDK. Look up "MinimizeAngle(a,b)" and you should be fine.

Cheers
Lennart

THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

On 13/11/2007 at 03:37, xxxxxxxx wrote:

MinimizeAngle?? Wow, the SDK surprises me every day again
Thanks a lot, Lennart!

Greetings,
Jack

THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

On 17/11/2007 at 05:08, xxxxxxxx wrote:

Well, unfortunately, there is no MinimizeAngle() function in the C++ SDK. But thanks anyway.

[EDIT]Ah, I see in C++ SDK it is called Vector GetOptimalAngle(const Vector& hpb_old, const Vector& hpb_new). Maybe I can make something out of that.[/EDIT]

THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

On 17/11/2007 at 11:59, xxxxxxxx wrote:

GetOptimalAngle(), yes.

THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

On 18/11/2007 at 06:04, xxxxxxxx wrote:

Hm, somehow it twists up all my angles. Now I wrote my own function and everything works fine. Thank you guys!

Greetings,
Jack