Berechnung von Fläche und Umfang der Kreise
Contents
[
Hide
]Wie man die Fläche und den Umfang der Kreise berechnet
Problem: Wie man die Fläche und den Umfang der Kreise berechnet (CADNET-1153).
Tipps: Um dies zu tun, holen Sie sich den Radius von CadEntityTypeName.CIRCLE aus den Entitäten und verwenden Sie die Formel “2 * Math.PI * radius”.
Beispiel:
This file contains 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); | |
} | |
} |