### Autor Tema: Get x and y (seperately) distance from one process to another (or more)  (Leído 3157 veces)

#### MisterN

• Hero Member
• Mensajes: 650
• Karma: 4
##### Get x and y (seperately) distance from one process to another (or more)
« en: Junio 21, 2012, 03:29:12 am »
Exactly what the title says. That would be a very good thing to have.
werg

#### SplinterGU

• Hero Member
• Mensajes: 12819
• Karma: 376
##### Re:Get x and y (seperately) distance from one process to another (or more)
« Respuesta #1 en: Junio 21, 2012, 01:46:33 pm »
Código: [Seleccionar]
`#define get_dist_x(pid) get_distx(get_angle(pid),get_dist(pid))#define get_dist_y(pid) get_disty(get_angle(pid),get_dist(pid))`

#### BlackCurtain

• Full Member
• Mensajes: 187
• Karma: 9
##### Re:Get x and y (seperately) distance from one process to another (or more)
« Respuesta #2 en: Junio 21, 2012, 04:39:12 pm »
I guess what Splinter is trying to say is that we should start thinking twice before making suggestions
You can achieve many "custom" functions with the tools you already have at hand.

#### handsource-dyko

• Hero Member
• Mensajes: 568
• Karma: 32
• I'm the eye in the sky.
##### Re:Get x and y (seperately) distance from one process to another (or more)
« Respuesta #3 en: Junio 27, 2012, 11:44:49 am »
Precisely.  I used to think that way too, until I realised that you can make your own (powerfull) functions by using/combining existing ones.
Believe me, when you get more experienced you start to think in creating your own solutions. (It's the C/Unix philosophy, using small functions to create solutions for more complex problems).

Like lego's, just a bunch of simple blocks, but that can be combined in a virtually infinite number of ways to create the most complex structures.
I used to play with lego bricks a lot, it was a by far my favorite toy.