Say I have two vectors, v and v2. I see elsewhere that I can multiply them together in Haxe like so:

```
v.x *= v2.x;
v.y *= v2.y;
v.z *= v2.z;
```

But can you similarly divide one vector by another like this?

```
v.x /= v2.x;
v.y /= v2.y;
v.z /= v2.z;
```

Say I have two vectors, v and v2. I see elsewhere that I can multiply them together in Haxe like so:

```
v.x *= v2.x;
v.y *= v2.y;
v.z *= v2.z;
```

But can you similarly divide one vector by another like this?

```
v.x /= v2.x;
v.y /= v2.y;
v.z /= v2.z;
```

0 Likes

That depends on whether the vector implementation implements the operator. Haxe’s operator overloading does support both in principle.

0 Likes

Armory’s vector classes don’t have the operator overloading so that you can use the `*=`

or `/=`

operators on them. It looks like there isn’t a divide function in Armory’s Vector class either.

0 Likes

Mr Blob multiplies element by element so this doesn’t require operator overloading and consequently the answer is: Yes.

0 Likes

Ah, should’ve paid more attention to the code example than the question. He isn’t actually dividing *vectors* there.

1 Like