{"size": 1007, "ext": "scrbl", "max_stars_repo_path": "scribblings/sines.scrbl", "max_stars_repo_name": "maueroats/Plot-cookbook", "max_stars_repo_stars_event_min_datetime": "2022-01-15T08:37:22.000Z", "max_stars_repo_stars_event_max_datetime": "2022-02-06T14:48:38.000Z", "max_issues_repo_path": "scribblings/sines.scrbl", "max_issues_repo_name": "maueroats/Plot-cookbook", "max_issues_repo_issues_event_min_datetime": "2022-01-14T21:15:26.000Z", "max_issues_repo_issues_event_max_datetime": "2022-01-20T17:22:46.000Z", "max_forks_repo_path": "scribblings/sines.scrbl", "max_forks_repo_name": "maueroats/Plot-cookbook", "max_forks_repo_forks_event_min_datetime": "2022-01-16T02:35:51.000Z", "max_forks_repo_forks_event_max_datetime": "2022-01-19T14:15:23.000Z"}
{"max_stars_count": 17, "max_issues_count": 4, "max_forks_count": 6, "avg_line_length": 27.2162162162, "max_line_length": 71, "alphanum_fraction": 0.4409136048}
#lang scribble/manual

@(require "common.rkt" infix plot/pict threading)

@title[#:tag "Sines"]{Sines}

Overlaying a set of sine functions in a single plot.

@;@racketinput[]
@interaction[#:eval plot-eval
                    (eval:alts (require infix
                                        plot/pict
                                        threading) (void))
(define (f a x) @${sin[(10+a)*x]})
(define (g a x) @${x / (a+5)})

(parameterize ([line-width 2]
               [plot-x-label "Degrees"]
               [plot-y-label "Magnitude"]
               [plot-y-ticks (linear-ticks #:number 5)]
               [plot-width 800]
               [plot-aspect-ratio 2]
               [plot-legend-anchor 'outside-right-top])

  (plot (for/list ([a (inclusive-range 1 6)])
          (function (λ~>> degrees->radians
                          (f a)
                          (g a))
                    0 50
                    #:color a
                    #:label (~a "1/" (+ a 5) " sin " (+ 10 a) "x")))))]





