Author Topic: {Challenge} Point Sort  (Read 2019 times)

0 Members and 1 Guest are viewing this topic.

Jeff H

  • Needs a day job
  • Posts: 6144
{Challenge} Point Sort
« on: February 12, 2011, 04:09:53 PM »
I do not know if this is a good one but I threw together code real quick and created 2 drawings

1. 20,000 random points with x,y,z (-100 to 100, -100 to 100, 0)

2. 20,000 random points with x,y,z (-100 to 100, -100 to 100, -100 to 100)


Any ideas maybe sort by closest to orgin in QI , then closest to orgin QII, then QIII, then QIV then repeat.

I do not know. I sounded like a good idea until i started typing all this.

2 drawings attached I saved them down to 2004

pkohut

  • Bull Frog
  • Posts: 483
Re: {Challenge} Point Sort
« Reply #1 on: February 12, 2011, 04:40:56 PM »
What are QI to QIV in reference to? Otherwise point sorting is relatively easy.
New tread (not retired) - public repo at https://github.com/pkohut

Kerry

  • Mesozoic relic
  • Seagull
  • Posts: 11654
  • class keyThumper<T>:ILazy<T>
Re: {Challenge} Point Sort
« Reply #2 on: February 12, 2011, 04:46:44 PM »

I imagine they'd be geomertic quadrants Paul.

0-90, 90-180 etc
kdub, kdub_nz in other timelines.
Perfection is not optional.
Everything will work just as you expect it to, unless your expectations are incorrect.
Discipline: None at all.

Jeff H

  • Needs a day job
  • Posts: 6144
Re: {Challenge} Point Sort
« Reply #3 on: February 12, 2011, 04:57:57 PM »
What are QI to QIV in reference to?
Quadrant 1 , Quadrant 2 , Quadrant 3 .........

Otherwise point sorting is relatively easy.

Yeah I was trying to come up with a idea like sorting points by largest difference between a Points X & Y value, but it still boils down to essentially they same thing.
I was trying to spark an idea.

gile

  • Gator
  • Posts: 2507
  • Marseille, France
Re: {Challenge} Point Sort
« Reply #4 on: February 12, 2011, 05:00:19 PM »
Code: [Select]
pts.Sort((p1, p2) => p1.DistanceTo(Point3d.Origin).CompareTo(p2.DistanceTo(Point3d.Origin)));
Speaking English as a French Frog