경계정의
2026년 5월 28일 09:30분
민수기 34장에서 가나안 땅의 남북동서 경계가 명확히 정의됩니다. 영역은 경계 좌표로 정의되고 포함 여부를 검사합니다. 나는 경계 좌표를 등록하고 특정 지점이 영역 내인지 확인하는 경계기를 만들었습니다.
package com.jesusbornd.numbers;
public class Numbers_34_Chapter_Lv1 {
record Boundary(double minX, double maxX, double minY, double maxY) {
boolean contains(double x, double y) {
return x >= minX && x <= maxX && y >= minY && y <= maxY;
}
}
record Point(String name, double x, double y) {}
public static void main(String[] args) {
var canaan = new Boundary(34.0, 36.5, 29.5, 33.5);
var points = java.util.List.of(
new Point("브엘세바", 34.8, 31.2),
new Point("단", 35.6, 33.2),
new Point("다마스쿠스",36.3, 33.5),
new Point("바그다드", 44.4, 33.3)
);
points.forEach(p ->
System.out.printf("%-12s (%.1f, %.1f) → %s%n",
p.name(), p.x(), p.y(), canaan.contains(p.x(), p.y()) ? "✅ 영역 내" : "❌ 영역 외"));
}
}
def in_canaan(x, y, min_x=34.0, max_x=36.5, min_y=29.5, max_y=33.5):
return min_x <= x <= max_x and min_y <= y <= max_y
if __name__ == "__main__":
points = [
("브엘세바", 34.8, 31.2),
("단", 35.6, 33.2),
("다마스쿠스", 36.3, 33.5),
("바그다드", 44.4, 33.3),
]
for name, x, y in points:
result = "✅ 영역 내" if in_canaan(x, y) else "❌ 영역 외"
print(f"{name:<12} ({x:.1f}, {y:.1f}) → {result}")
Search
Categories
← 목록으로
Comments
영역의 경계를 명확히 정의하는 것이 모든 배분의 시작이네요.