Add toroidal wrap function
还没有人认领这个 Issue。
评估
调研方向
首先定位 Processing 核心库中现有的数学入口点以及任何相关的 wrap 逻辑。定义 issue 中描述的环面 wrap 函数,然后为小于零的值、大于或等于最大值的值,以及已经处于范围内的值添加或更新测试覆盖率。
由索引模型根据 Issue 内容生成。
描述
Relevant sub-area for this feature?
Math
Feature details
Feature description
In many programs a value starts again at zero if it gets larger than a max value or appears at max value when it goes below zero. Provide a function that does the wrapping as a single function.
/**
* Wraps a value at 0 and max to constrain value between zero and max.
* @param value The value to wrap
* @param max The maximum value (excluded)
* @return The toroidally wrapped value
float wrap(float value, float max) {
if (value < 0) {
return value + max;
} else if (value >= max) {
return value - max;
}
return value;
}
Benefits
This would reduce code sizes and make these toroidal worlds easier to understand.
Would you like to help implement this feature?
Yes, I’d like to help with this
- 主要语言
- Java
- 星标
- 497
- 派生
- 183
- 平均合并
- 4 小时 39 分钟
- 30 天内合并 PR
- 3
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
processing/processing4 的其他 Issue
-
bug
难度 2/5 1-3 小时 新手友好度 64/100
processing/processing4#1554 · 1 条评论 ·
-
难度 2/5 1-3 小时 新手友好度 76/100
processing/processing4#1515 · 1 个 reaction ·
-
bug
难度 3/5 1-2 天 新手友好度 55/100
processing/processing4#1573 ·
-
startup error 未关闭
难度 4/5 3-5 天 新手友好度 25/100
processing/processing4#1569 · 7 条评论 ·
-
Binaries under bin directory lack executable permissions for the snap and .deb packages for Linux 未关闭bug
processing/processing4#1567 · 3 条评论 · 1 个 reaction · 已指派 1 人 ·
查看 processing/processing4 的全部 Issue
相似的 Issue
-
certification
难度 1/5 1 小时以内 新手友好度 80/100
-
难度 2/5 1-3 小时 新手友好度 75/100
-
[BUG] ECR GetAuthorizationToken returns a proxyEndpoint for the default region, not the request's 未关闭bug ecr
难度 2/5 1-3 小时 新手友好度 75/100
-
Needs: Triage Type: Feature request
难度 2/5 1-3 小时 新手友好度 70/100
AntennaPod/AntennaPod#8794 ·
-
agentic-workflows
难度 2/5 1-3 小时 新手友好度 65/100
github/copilot-sdk#2760 ·