On 8/30/15 3:45 PM, Spacen Jasset wrote:
On Sunday, 30 August 2015 at 18:12:40 UTC, BBasile wrote:
On Sunday, 30 August 2015 at 17:02:58 UTC, Spacen Jasset wrote:
[...]
try
---
Vector3 opBinary(string op)(Vector3 rhs)
{
static if (op =="/"){}
else static assert(0, op ~ " not implemen
On Sunday, 30 August 2015 at 20:09:25 UTC, Timon Gehr wrote:
On 08/30/2015 07:02 PM, Spacen Jasset wrote:
[...]
import std.math: sqrt;
import std.algorithm: map,sum,canFind;
struct Vector3{
float[3] xyz;
void normalise(){ this/=magnitude(); }
float magnitude(){ return sqrt(xyz[].
On 08/30/2015 07:02 PM, Spacen Jasset wrote:
I have just added an opDiv to this class, but it doesn't seem to pick it
up.
math/vector.d(30): Error: 'this /= mag' is not a scalar, it is a Vector3
I can't see why that is, becuase my opMul works in the same place. Can
anyone point out what I have d
On Sunday, 30 August 2015 at 18:12:40 UTC, BBasile wrote:
On Sunday, 30 August 2015 at 17:02:58 UTC, Spacen Jasset wrote:
[...]
try
---
Vector3 opBinary(string op)(Vector3 rhs)
{
static if (op =="/"){}
else static assert(0, op ~ " not implemented");
}
---
you used the char litteral d
On Sunday, 30 August 2015 at 17:02:58 UTC, Spacen Jasset wrote:
I have just added an opDiv to this class, but it doesn't seem
to pick it up.
math/vector.d(30): Error: 'this /= mag' is not a scalar, it is
a Vector3
I can't see why that is, becuase my opMul works in the same
place. Can anyone p
On Sunday, 30 August 2015 at 17:02:58 UTC, Spacen Jasset wrote:
I have just added an opDiv to this class, but it doesn't seem
to pick it up.
math/vector.d(30): Error: 'this /= mag' is not a scalar, it is
a Vector3
I can't see why that is, becuase my opMul works in the same
place. Can anyone p
I have just added an opDiv to this class, but it doesn't seem to
pick it up.
math/vector.d(30): Error: 'this /= mag' is not a scalar, it is a
Vector3
I can't see why that is, becuase my opMul works in the same
place. Can anyone point out what I have done wrong?
Class Matrix {
void norma