원의 면적과 둘레 계산
Contents
[
Hide
]원의 면적과 둘레 계산 방법
문제: 원의 면적과 둘레 계산 방법 (CADNET-1153).
팁: 이를 위해 CadEntityTypeName.CIRCLE에서 반지름을 가져오고 수식 **“2 * Math.PI * radius”**를 사용하세요.
예제:
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
foreach (CadBaseEntity entity in cadImage.Entities) | |
{ | |
if (entity.TypeName == CadEntityTypeName.CIRCLE) | |
{ | |
double radius = ((CadCircle)entity).Radius; | |
System.Console.WriteLine("Circumference= " + 2 * Math.PI * radius); | |
System.Console.WriteLine("Area= " + Math.PI * radius * radius); | |
} | |
} |