Dairelerin alanını ve çevresini hesaplama
Contents
[
Hide
]Dairelerin alanını ve çevresini nasıl hesaplayabilirsiniz
Sorun: Dairelerin alanını ve çevresini nasıl hesaplayabilirsiniz (CADNET-1153).
İpuçları: Bunu yapmak için, varlıklardan CadEntityTypeName.CIRCLE’dan yarıçapı alın ve “2 * Math.PI * radius” formülünü kullanın.
Örnek:
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); | |
} | |
} |