Confusing example for PVector copy() method
还没有人认领这个 Issue。
评估
- 难度
- 1/5
- 预计耗时
- 1-3 小时
- 新手友好度
- 55/100
- Issue 类型
- 文档
- 描述清晰度
- 描述清楚
- 活跃度
- 停滞
调研方向
从 issue 中链接的 PVector copy() 参考页面开始,找到其中的 Examples 部分。检查示例中的对象初始化和复制赋值,然后更新示例,使其不再执行多余的初始化。完成更改后,验证渲染后的文档示例。
由索引模型根据 Issue 内容生成。
描述
Select the type of content error.
Other content error (please specify)
Section
Examples
Location of the error
https://processing.org/reference/PVector_copy_.html
Describe the error
In the documentation for the copy() method of the PVector class, the following code example is given:
PVector v1, v2;
void setup() {
size(100, 100);
v1 = new PVector(20.0, 30.0, 40.0);
v2 = new PVector();
v2 = v1.copy();
...
While not a factual error, it seems curious to me that v2 would be instantiated as a new PVector only to be assigned the result of v1.copy(). If .copy() creates a returns a new PVector object, then the initial assignment would have no effect. This led to some confusion amongst my students who had various incorrect assumptions about how .copy() works given the example code.
Suggested correction
PVector v1, v2;
void setup() {
size(100, 100);
v1 = new PVector(20.0, 30.0, 40.0);
v2 = v1.copy();
...
Language
No response
Screenshots or references
No response
Additional context
No response
- 主要语言
- MDX
- 星标
- 90
- 派生
- 122
- 平均合并
- 1 小时 43 分钟
- 30 天内合并 PR
- 3
贡献指南
这个仓库没有索引到贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
processing/processing-website 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 76/100
processing/processing-website#716 ·
-
难度 2/5 1-3 小时 新手友好度 68/100
processing/processing-website#703 ·
-
Good First Issue Help Wanted Reference
难度 1/5 1 小时以内 新手友好度 90/100
processing/processing-website#698 · 5 条评论 · 1 个 reaction ·
-
难度 1/5 1 小时以内 新手友好度 72/100
processing/processing-website#681 · 2 条评论 ·
-
难度 2/5 1-3 小时 新手友好度 65/100
processing/processing-website#646 · 3 条评论 ·
查看 processing/processing-website 的全部 Issue
相似的 Issue
-
triage
难度 1/5 1-3 小时 新手友好度 88/100
-
enhancement
难度 2/5 1-3 小时 新手友好度 72/100
-
feature pydanty:is-working
难度 1/5 1 小时以内 新手友好度 88/100
pydantic/pydantic-ai#8647 ·
-
难度 2/5 1-3 小时 新手友好度 68/100
-
:watch: Not Triaged dotnet-fsharp/svc
难度 1/5 1 小时以内 新手友好度 90/100