Hey guys, I need to write a struct that measures the distance from a point (x,y,z) to the origin. I am good on how to write it as a struct, I just don't know the formula for the distance. Can someone help me out? Also, the formula for a dot product of 2 vectors.

The distance from the origin, assuming you're using Euclidean distance, is sqrt(x^2 + y^2 + z^2).

The dot product? Google it.

gotcha thank you very much.