class PointInPlane {
public float x;
public float y;
static class CircleInPlane {
public static float r;
public static float xcentr;
public static float ycentr;
static void solve(PointInPlane a, PointInPlane b, PointInPlane c) {
float A = (b.y-a.y)/(b.x-a.x); //geting NullPointerExeption
float B = (c.y-b.y)/(c.x-b.x); //probably will get in all next steps
xcentr = (A*B*(a.y-c.y)+B*(a.x+b.x)-A*(b.x+c.x))/(2*(B-A));
ycentr = A*(xcentr-a.x)+a.y;
r = sqrt((pow((a.x - xcentr), 2) + pow((a.y - ycentr), 2)));
}
}
}
So IDK how I can handle this problem. I'm getting NullPointerException
when declare float A. I think the problem is that I'm using fields from one class in another or trying to use PointInPlane objects a, b and c with null fields. How this problem could be solved?