devxlogo

Tip Bank

Optimize C++ Code with Member Initializers

Calling constructors for the data members of the object of a class results in an overhead process which calls the constructor in the main function. You can reduce this overhead

Calculate the Angle Between Two Lines

This code shows you how to calculate the angle between two lines using vectors and an inverse cosine function: Public Function getAngleBetweenLinesVect(commonX As Single, commonY As Single, X1 As Single,