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

Method __rdiv__

src/main/java/field/linalg/Vec2.java:1567–1586  ·  view source on GitHub ↗
(Object b)

Source from the content-addressed store, hash-verified

1565 }
1566
1567 @Override
1568 public Object __rdiv__(Object b) {
1569 if (b instanceof Number)
1570 return new Vec2(((Number) b).doubleValue()/this.x, ((Number) b).doubleValue()/this.y);
1571
1572 Vec2 c = convertToVec2(b);
1573 if (c != null)
1574 return new Vec2(c.x/this.x , c.y/this.y);
1575
1576 if (b instanceof Quat) {
1577 return ((Quat) b).transform(this, new Vec2());
1578 }
1579
1580 if (b instanceof Vec4) {
1581 return this.toVec4().div((Vec4) b);
1582 }
1583
1584 throw new ClassCastException(" can't divide '" + b + "' and a Vec2 (" + this + ")");
1585
1586 }
1587
1588
1589 @Override

Callers

nothing calls this directly

Calls 4

convertToVec2Method · 0.95
toVec4Method · 0.95
transformMethod · 0.65
divMethod · 0.45

Tested by

no test coverage detected