Link to home
Start Free TrialLog in
Avatar of Rad1
Rad1

asked on

C# Add Function Question

Hi,

Could anyone explain this function Add please?

the ..... dots too.

Thank you,

public class Vertex3d
{ 
.. .
public static Vertex3d Add(Vertex3d a, Vertex3d b)
{ 
Vertex3d result = new Vertex3d();
result. X = a. X + b. X;
result. Y = a. Y + b. Y;
result. Z = a. Z + b. Z;
return result;
}
}
The static method is called like in this example:
Vertex3d a = new Vertex3d(0, 0, 1) ;
Vertex3d b = new Vertex3d(1 , 0, 1) ;
Vertex3d sum = Vertex3d. Add( a, b);

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of Ashok
Ashok
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
In line 16, you are passing both Vertex3d to the function
and
assigning result to sum

Ashok
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Rad1
Rad1

ASKER

Thank you very much for all your help.

It is clear now.