我需要找到这种形状的外接圆和内圆

我的代码找到了外接圆,但是外圆是错的
for (int r = 1; ; r++) //r is radius
{
int found = 0; //counts found pixels
int wrong = 0; //counts pixels that are on the circle but have different color that desirable
int good = 0; //counts pixels that are on the circle with desirable color
for (int y = point.Y - r ; y <= point.Y + r ; y++) //point is the center of the figure (110,110)
{
for (int x = point.X …Run Code Online (Sandbox Code Playgroud) 我在 Sof链接上找到了这个解决方案, 但我不得不从两个原因改变它:
我的代码是这样的:
FacesContext facesContext = FacesContext.getCurrentInstance();
HttpServletResponse response = (HttpServletResponse) facesContext.getExternalContext().getResponse();
response.addHeader("Set-Cookie", "; HTTPOnly");
Run Code Online (Sandbox Code Playgroud)
原始代码
FacesContext facesContext = FacesContext.getCurrentInstance().getFacesContext();
HttpServletResponse response = (HttpServletResponse) facesContext.getExternalContext().getResponse();
response.addHeader("Set-Cookie", "yourcookiename=yourcookievalue; HTTPOnly");
Run Code Online (Sandbox Code Playgroud)
如果我错了,请纠正我。先感谢您