Skip to main content
Add syntax highlighting and correct minor typos
Source Link

Is there any length of the Does a point have a length?

I am going though a functional source that havehas the following class:

 class Point3D
 {
       int x ,y,z;

       int vSize2() const
       {
           return x*x +
                  y*y +
                  z*z;
       }


       int vSize() const
       {
         return sqrt(vSize2());
       }           
 };
 class Point3D
 {
       int x ,y,z;

       int vSize2() const
       {
           return x*x +
                  y*y +
                  z*z;
       }


       int vSize() const
       {
         return sqrt(vSize2());
       }           
 };

It is hard to understand the functionalities of the above two functions (vSize2()vSize2() and vSize()vSize()). It seems to me that it is calculating the length between the point and the origin.

Any thoughts  ?

Is there any length of the a point?

I am going though a functional source that have the following class:

 class Point3D
 {
       int x ,y,z;

       int vSize2() const
       {
           return x*x +
                  y*y +
                  z*z;
       }


       int vSize() const
       {
         return sqrt(vSize2());
       }           
 };

It is hard to understand the functionalities of the above two functions (vSize2() and vSize()). It seems to me that it is calculating the length between the point and the origin.

Any thoughts  ?

Does a point have a length?

I am going though a functional source that has the following class:

 class Point3D
 {
       int x ,y,z;

       int vSize2() const
       {
           return x*x +
                  y*y +
                  z*z;
       }


       int vSize() const
       {
         return sqrt(vSize2());
       }           
 };

It is hard to understand the functionalities of the above two functions (vSize2() and vSize()). It seems to me that it is calculating the length between the point and the origin.

Any thoughts?

edited tags
Link
Source Link
sajis997
  • 1.3k
  • 1
  • 10
  • 15

Is there any length of the a point?

I am going though a functional source that have the following class:

 class Point3D
 {
       int x ,y,z;

       int vSize2() const
       {
           return x*x +
                  y*y +
                  z*z;
       }


       int vSize() const
       {
         return sqrt(vSize2());
       }           
 };

It is hard to understand the functionalities of the above two functions (vSize2() and vSize()). It seems to me that it is calculating the length between the point and the origin.

Any thoughts ?