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

Method __rdiv__

src/main/java/field/linalg/Vec3.java:1876–1895  ·  view source on GitHub ↗
(Object b)

Source from the content-addressed store, hash-verified

1874 }
1875
1876 @Override
1877 public Object __rdiv__(Object b) {
1878 if (b instanceof Number)
1879 return new Vec3(((Number) b).doubleValue()/this.x, ((Number) b).doubleValue()/this.y, ((Number) b).doubleValue()/this.z);
1880
1881 Vec3 c = convertToVec3(b);
1882 if (c != null)
1883 return new Vec3(c.x/this.x , c.y/this.y, c.z/this.z );
1884
1885 if (b instanceof Quat) {
1886 return ((Quat) b).transform(this, new Vec3());
1887 }
1888
1889 if (b instanceof Vec4) {
1890 return this.toVec4().div((Vec4) b);
1891 }
1892
1893 throw new ClassCastException(" can't divide '" + b + "' adn a Vec3 (" + this + ")");
1894
1895 }
1896
1897
1898 @Override

Callers

nothing calls this directly

Calls 4

convertToVec3Method · 0.95
toVec4Method · 0.95
transformMethod · 0.65
divMethod · 0.45

Tested by

no test coverage detected