processing / processing/processing-website
Confusing example for PVector copy() method
还没有人认领这个 Issue。
- 主要语言
- MDX
- 星标
- 90
- 派生
- 122
- 平均合并
- 1 小时 43 分钟
- 30 天内合并 PR
- 3
描述
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
贡献指南
这个仓库没有索引到贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
调研方向
从 issue 中链接的 PVector copy() 参考页面开始,找到其中的 Examples 部分。检查示例中的对象初始化和复制赋值,然后更新示例,使其不再执行多余的初始化。完成更改后,验证渲染后的文档示例。
由索引模型根据 Issue 内容生成。
评估
- 领域
- documentation
- Issue 类型
- 文档
- 难度
- 1/5
- 预计耗时
- 1-3 小时
- 活跃度
- 停滞
- 描述清晰度
- 描述清楚
- 新手友好度
- 55/100