p5.js icon indicating copy to clipboard operation
p5.js copied to clipboard

Calculation map() Documentation Enhancement

Open ronyginosar opened this issue 1 year ago • 1 comments

Increasing access

No

Most appropriate sub-area of p5.js?

  • [ ] Accessibility
  • [ ] Color
  • [ ] Core/Environment/Rendering
  • [ ] Data
  • [ ] DOM
  • [ ] Events
  • [ ] Image
  • [ ] IO
  • [X] Math
  • [ ] Typography
  • [ ] Utilities
  • [ ] WebGL
  • [ ] Build process
  • [ ] Unit testing
  • [ ] Internationalization
  • [ ] Friendly errors
  • [X] Other (specify if possible)
  • [X] Documentation
  • [X] Calculation

Feature enhancement details

I'd like to propose specifying in the documentation that map() preforms a linear mapping: https://p5js.org/reference/p5/map/ I'd also add a recommendation to use manual mappings for different needs.

ronyginosar avatar Jul 31 '24 08:07 ronyginosar

Welcome! 👋 Thanks for opening your first issue here! And to ensure the community is able to respond to your issue, please make sure to fill out the inputs in the issue forms. Thank you!

welcome[bot] avatar Jul 31 '24 08:07 welcome[bot]

I have updated the documentation. Please check.
@limzykenneth @ericnlchen @ChihYungChang @bsubbaraman @albertomancia @JazerUCSB @tedkmburu @perminder-17 @Obi-Engine10 @jeanetteandrews

gulshan-123 avatar Mar 21 '25 04:03 gulshan-123

Hi @ronyginosar ! Can you describe a bit more what you have in mind, please? For example, if I as a user want to map a number x using some non-linear function (sin for example), I can use that function directly (sin(x)). The map function is specifically to simplify linear mapping, which is both very common and also a little bit verbose to write out arithmetically. Or am I misunderstanding the idea?

@gulshan-123 I saw you had made a PR, unfortunately I had to close it as there is not yet a specific decision on this issue, but please feel free to chime in here about this. For work to be approved, the "improve access" question has to be answered, as this is a core value of the project.

ksen0 avatar Mar 25 '25 14:03 ksen0