package sagital.net.geo;
import anywheresoftware.b4a.BA.ShortName;
import anywheresoftware.b4a.BA.Version;
@ShortName("geometry")
@Version(value = 1)
public class geometry{
/*
* Calculate Cube Surface by his x,y,z
*/
public double CubeGetSurface(double x, double y, double z) {
return (((x * y) * 2) + ((x * z) * 2) + ((y * z) * 2));
}
/*
* Calculate Cube Volume by his x,y,z
*/
public double CubeGetVolume(double x, double y, double z) {
return x*y*z;
}
/*
* Calculate Circle Area by his radius
*/
public double CircleGetArea(double r) {
return Math.PI * Math.pow(r, 2);
}
/*
* Calculate Sphere Surface Area by his radius
*/
public double SphereGetSurfaceArea(double r) {
return 4 * Math.PI * Math.pow(r, 2);
}
/*
* Calculate Sphere Volume by his radius
*/
public double SphereGetVolume(double r) {
return (double) 4/3 * Math.PI * Math.pow(r, 3);
}
/*
* Calculate Square Area by his x,y
*/
public double SquareGetArea(double x, double y) {
return (x * y);
}
}