Author |
Message |
SFR

Joined: 26 Oct 2011 Posts: 1749
|
Posted: Fri 12 Dec 2014, 19:19 Post subject:
|
|
Bash does not support trigonometric functions and floating point operations at all.
Both bc and awk do, but personally I'd choose the latter, as it's easier to cut off the floating point part:
Code: | # DEG=70; RADIUS=300; originX=0; originY=0
# SIN=`awk 'BEGIN {printf("%.0f\n", '$originX' + '$RADIUS' * sin('$DEG' * (3.14 / 180) ))}'`
# COS=`awk 'BEGIN {printf("%.0f\n", '$originY' + '$RADIUS' * cos('$DEG' * (3.14 / 180) ))}'`
# echo "Sin=$SIN Cos=$COS"
Sin=282 Cos=103
# |
Note that bc & awk operate in radians, that's why *(3.14/180).
PS.I was never good at trigonometry, but hopefully the above is correct...
Greetings!
_________________ [O]bdurate [R]ules [D]estroy [E]nthusiastic [R]ebels => [C]reative [H]umans [A]lways [O]pen [S]ource
Omnia mea mecum porto.
|
Back to top
|
|
 |
LazY Puppy

Joined: 21 Nov 2014 Posts: 2007 Location: Germany
|
Posted: Fri 12 Dec 2014, 20:10 Post subject:
|
|
stemsee wrote: | Thanks ... I had a look but didn't click for me! |
Sorry.
I just entered man cos into the terminal and it just popped up this page in a browser. Just did not have deeper look into the results.
_________________ RSH
"you only wanted to work your Puppies in German", "you are a separatist in that you want Germany to secede from Europe" (musher0)
No, but I gave my old drum kit away for free to a music store collecting instruments for refugees! 
|
Back to top
|
|
 |
stemsee
Joined: 27 Jun 2013 Posts: 2543 Location: In The Way
|
Posted: Fri 12 Dec 2014, 21:36 Post subject:
|
|
thanks @SFR
I am on the right track now.
@ RSH no problem.
|
Back to top
|
|
 |
stemsee
Joined: 27 Jun 2013 Posts: 2543 Location: In The Way
|
Posted: Fri 12 Dec 2014, 21:46 Post subject:
|
|
Nicons-v2.3 released for testing. see first post
Comes with ten presets.
|
Back to top
|
|
 |
stemsee
Joined: 27 Jun 2013 Posts: 2543 Location: In The Way
|
Posted: Sat 13 Dec 2014, 13:31 Post subject:
|
|
First circlular appears! Yippee.
Description |
2nd circlular |
Filesize |
25.83 KB |
Viewed |
377 Time(s) |

|
Description |
rad |
Filesize |
27.34 KB |
Viewed |
373 Time(s) |

|
|
Back to top
|
|
 |
stemsee
Joined: 27 Jun 2013 Posts: 2543 Location: In The Way
|
Posted: Sat 13 Dec 2014, 18:47 Post subject:
|
|
circle manipulated
Description |
|
Filesize |
23.27 KB |
Viewed |
352 Time(s) |

|
|
Back to top
|
|
 |
stemsee
Joined: 27 Jun 2013 Posts: 2543 Location: In The Way
|
Posted: Sun 14 Dec 2014, 09:35 Post subject:
|
|
getting mastery over the circle's attributes and positioning.
Description |
centred |
Filesize |
26.89 KB |
Viewed |
334 Time(s) |

|
Description |
the beginning of concentric circles |
Filesize |
26.19 KB |
Viewed |
337 Time(s) |

|
Description |
squiggles |
Filesize |
26.38 KB |
Viewed |
332 Time(s) |

|
|
Back to top
|
|
 |
stemsee
Joined: 27 Jun 2013 Posts: 2543 Location: In The Way
|
Posted: Sun 14 Dec 2014, 09:41 Post subject:
|
|
35 icons to form a circle
Description |
|
Filesize |
26.75 KB |
Viewed |
331 Time(s) |

|
|
Back to top
|
|
 |
stemsee
Joined: 27 Jun 2013 Posts: 2543 Location: In The Way
|
Posted: Sun 14 Dec 2014, 11:35 Post subject:
|
|
trying for spirals
Description |
ex |
Filesize |
26.78 KB |
Viewed |
333 Time(s) |

|
Description |
experiment |
Filesize |
29.89 KB |
Viewed |
326 Time(s) |

|
|
Back to top
|
|
 |
stemsee
Joined: 27 Jun 2013 Posts: 2543 Location: In The Way
|
Posted: Sun 14 Dec 2014, 11:37 Post subject:
|
|
ex
Description |
|
Filesize |
31.74 KB |
Viewed |
319 Time(s) |

|
|
Back to top
|
|
 |
stemsee
Joined: 27 Jun 2013 Posts: 2543 Location: In The Way
|
Posted: Sun 14 Dec 2014, 11:41 Post subject:
|
|
Spiral acheived!
Description |
|
Filesize |
36.73 KB |
Viewed |
317 Time(s) |

|
Description |
spiral |
Filesize |
32.98 KB |
Viewed |
315 Time(s) |

|
|
Back to top
|
|
 |
stemsee
Joined: 27 Jun 2013 Posts: 2543 Location: In The Way
|
Posted: Sun 14 Dec 2014, 12:12 Post subject:
|
|
Two presets added: Spiral and Circle.
To do
1) Concentric circles
2) multiple circles
3) Love Hearts
|
Back to top
|
|
 |
stemsee
Joined: 27 Jun 2013 Posts: 2543 Location: In The Way
|
Posted: Sun 14 Dec 2014, 12:22 Post subject:
|
|
Added combo preset surrounded spiral
Description |
surrounded spiral |
Filesize |
35.49 KB |
Viewed |
312 Time(s) |

|
|
Back to top
|
|
 |
stemsee
Joined: 27 Jun 2013 Posts: 2543 Location: In The Way
|
Posted: Sun 14 Dec 2014, 12:28 Post subject:
|
|
squared circle
Description |
|
Filesize |
27.53 KB |
Viewed |
315 Time(s) |

|
Description |
squared circles |
Filesize |
22.85 KB |
Viewed |
315 Time(s) |

|
|
Back to top
|
|
 |
stemsee
Joined: 27 Jun 2013 Posts: 2543 Location: In The Way
|
Posted: Sun 14 Dec 2014, 15:47 Post subject:
|
|
Star
Description |
star |
Filesize |
20.16 KB |
Viewed |
302 Time(s) |

|
|
Back to top
|
|
 |
|