- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I have a point array. I want to sort point of a polygon to calculate the area.
This is my list point:
- Point3d 1 X: 16.9739362797234 Y: 1.15620205549732 Z: 0 - Point3d 2 X: 16.671656969313 Y: 1.16417151545853 Z: 0 - Point3d 3 X: 16.0185770382255 Y: 1.18138967820743 Z: 0 - Point3d 4 X: 16.9739362797234 Y: 1.45620205549783 Z: 0 - Point3d 5 X: 15.7386856391879 Y: 1.48876889081456 Z: 0 - Point3d 6 X: 3.51984642951532 Y: 1.51091316764773 Z: 0 - Point3d 7 X: 3.51984642951532 Y: 1.81091316764773 Z: 0 - Point3d 8 X: -10.2845662421009 Y: 1.98207932732037 Z: 0 - Point3d 9 X: -10.6449687487931 Y: 1.9954460528974 Z: 0 - Point3d 10 X: -10.7612815869122 Y: 1.99064617997511 Z: 0 - Point3d 11 X: -10.8658975847679 Y: 1.99013890212357 Z: 0 - Point3d 12 X: -11.620742475742 Y: 1.98928295827633 Z: 0 - Point3d 13 X: -10.2845662417003 Y: 1.68207932730779 Z: 0 - Point3d 14 X: -10.6449687486466 Y: 1.69544605290257 Z: 0 - Point3d 15 X: -10.761281586839 Y: 1.69064617997781 Z: 0 - Point3d 16 X: -10.865897584949 Y: 1.69013890212357 Z: 0 - Point3d 17 X: -11.6207424763237 Y: 1.68928295827587 Z: 0 - Point3d 18 X: -15.6175840485863 Y: 1.99120797569964 Z: 0 - Point3d 19 X: -16.1629232880395 Y: 1.99147062997825 Z: 0 - Point3d 20 X: -15.6175840485863 Y: 1.69120797569966 Z: 0 - Point3d 20 X: -15.6175840485863 Y: 1.69120797569966 Z: 0 - Point3d 21 X: -16.1629232880395 Y: 1.69147062997776 Z: 0
My code:
var sortList = ltsPoint.OrderBy(x => Math.Atan2(x.Y, x.X)).ToList();
But not successful. Hope everybody help please, Thanks!
Solved! Go to Solution.
Link copied