-
Notifications
You must be signed in to change notification settings - Fork 5
Open
Description
Hi @simonech
Good to see someone else doing the ray tracer challenge with .NET CORE!
I have some suggestions if you don't mind :)
- Instead of creating a method called add, you can define an operator called + (same for -, /, *) like this:
public static Tupple operator +(Tupple left, Tupple right)
{
return new Tupple(left.X + right.X, left.Y + right.Y, left.Z + right.Z, left.W + right.W);
}usage:
var t1 = new Tupple(1.0f, 1.0f, 1.0f, 1.0f);
var t2 = new Tupple(2.0f, 2.0f, 2.0f, 2.0f);
var sum = t1 + t2;- I am not sure which version of .NET CORE you're using, but since
2.1 previewit has included a math library for float values
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request