MCPcopy Create free account
hub / github.com/OpenEndedGroup/Field2 / __div__

Method __div__

src/main/java/field/linalg/Vec4.java:1504–1527  ·  view source on GitHub ↗
(Object b)

Source from the content-addressed store, hash-verified

1502 throw new ClassCastException(" can't multiply '" + b + "' by a Vec3 (" + this + ")");
1503 }
1504
1505 @Override
1506 public Object __div__(Object b) {
1507 if (b instanceof Number)
1508 return new Vec4(this.x / ((Number) b).doubleValue(), this.y / ((Number) b).doubleValue(), this.z / ((Number) b).doubleValue(), this.w);
1509
1510 Vec4 c = convertToVec4(b);
1511 if (c != null)
1512 return new Vec4(this.x / c.x, this.y / c.y, this.z / c.z, this.w / c.w);
1513
1514 if (b instanceof Quat) {
1515 Quat q = new Quat();
1516 ((Quat) b).invert(q);
1517 return q.transform(this, new Vec4());
1518 }
1519
1520 if (b instanceof Vec4) {
1521 return this.div((Vec4) b);
1522 }
1523
1524 if (b instanceof OverloadedMath)
1525 return ((OverloadedMath) b).__rdiv__(this);
1526
1527 throw new ClassCastException(" can't divide '" + b + "' by a Vec4 (" + this + ")");
1528 }
1529
1530 @Override

Callers

nothing calls this directly

Calls 5

convertToVec4Method · 0.95
transformMethod · 0.95
divMethod · 0.95
__rdiv__Method · 0.65
invertMethod · 0.45

Tested by

no test coverage detected