Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

math - remap function #220

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
majvax merged 4 commits into quicksnip-dev:main from JasimAlrawie:main
Jan 10, 2025
Merged

math - remap function #220

majvax merged 4 commits into quicksnip-dev:main from JasimAlrawie:main
Jan 10, 2025

Conversation

Copy link
Contributor

@JasimAlrawie JasimAlrawie commented Jan 9, 2025
edited
Loading

Description

remap function

a function that remaps values from range to another range

Type of Change

  • ✨ New snippet
  • πŸ›  Improvement to an existing snippet
  • 🐞 Bug fix
  • πŸ“– Documentation update
  • πŸ”§ Other (please describe):

Checklist

  • I have tested my code and verified it works as expected.
  • My code follows the style and contribution guidelines of this project.
  • Comments are added where necessary for clarity.
  • Documentation has been updated (if applicable).
  • There are no new warnings or errors from my changes.

Related Issues

Closes #

Additional Context

Screenshots (Optional)

Click to view screenshots

Copy link
Collaborator

@Mathys-Gasnier Mathys-Gasnier Jan 9, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As this doesnt use any cpp feature over the c version, please remove it

Copy link
Contributor Author

@JasimAlrawie JasimAlrawie Jan 9, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

Copy link
Collaborator

@majvax majvax left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rename the function (and file) from remap to linear mapping or linear map as it don't make much sense to call it remap. I also don't like start1 start2.
It should be more explicit like min_in and min_out

JasimAlrawie reacted with thumbs up emoji
Copy link
Collaborator

@majvax majvax left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Few things to address + the title of each snippets should be Linear Mapping so it matches the file name.

Please carefully check for typo before requesting another review.

@@ -0,0 +1,19 @@
---
title: Linear Remappibg
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

typo

JasimAlrawie reacted with thumbs up emoji
@@ -0,0 +1,17 @@
---
title: Linear Renapping
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

typo

JasimAlrawie reacted with thumbs up emoji

```py

def linearMapping(value, minIn, maxIn, minOut, maxOut):
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should be lower_cased to follow pep8 standard

JasimAlrawie reacted with thumbs up emoji
Copy link
Contributor Author

@JasimAlrawie JasimAlrawie Jan 10, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

snake case ?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yep

@majvax majvax merged commit c9ae43c into quicksnip-dev:main Jan 10, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Reviewers

@majvax majvax majvax approved these changes

@Mathys-Gasnier Mathys-Gasnier Mathys-Gasnier approved these changes

@psychlone77 psychlone77 Awaiting requested review from psychlone77 psychlone77 is a code owner

@saminjay saminjay Awaiting requested review from saminjay saminjay is a code owner

Assignees
No one assigned
Labels
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

AltStyle γ«γ‚ˆγ£γ¦ε€‰ζ›γ•γ‚ŒγŸγƒšγƒΌγ‚Έ (->γ‚ͺγƒͺγ‚ΈγƒŠγƒ«) /