Skip to content

Commit d8fc541

Browse files
authored
Merge pull request #621 from babaissarkar/update_set_heading_json
Add JSON file for PVector#setHeading()
2 parents 55dbf8c + 8018e7e commit d8fc541

File tree

3 files changed

+38
-3
lines changed

3 files changed

+38
-3
lines changed

content/references/translations/en/processing/PVector.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,11 @@
9393
"name": "heading()",
9494
"desc": "Calculate the angle of rotation for this vector"
9595
},
96+
{
97+
"anchor": "PVector_setHeading_",
98+
"name": "setHeading()",
99+
"desc": "Set the direction for this vector"
100+
},
96101
{
97102
"anchor": "PVector_rotate_",
98103
"name": "rotate()",

content/references/translations/en/processing/PVector_heading_.json

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,18 @@
22
"brief": "Calculate the angle of rotation for this vector",
33
"related": [],
44
"name": "heading()",
5-
"description": "Calculate the angle of rotation for this vector (only 2D vectors)",
6-
"syntax": [".heading()"],
5+
"description": "Calculate the vector's direction, that is, the angle this vector makes\n with the positive X axis (only 2D vectors)",
6+
"syntax": ["myPVector.heading()"],
77
"returns": "float",
88
"type": "method",
99
"category": "pvector",
1010
"subcategory": "method",
1111
"classanchor": "PVector",
12-
"parameters": []
12+
"parameters": [
13+
{
14+
"name": "myPVector",
15+
"description": "your PVector object",
16+
"type": ["PVector"]
17+
}
18+
]
1319
}
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
{
2+
"brief": "Set the direction for this vector",
3+
"related": ["PVector_heading_"],
4+
"name": "setHeading()",
5+
"description": "Sets the angle this vector makes with the positive X axis (only 2D vectors)\n This is equivalent to changing the vector's direction to the given value.",
6+
"syntax": ["myPVector.setHeading(angle)"],
7+
"returns": "PVector",
8+
"type": "method",
9+
"category": "pvector",
10+
"subcategory": "method",
11+
"classanchor": "PVector",
12+
"parameters": [
13+
{
14+
"name": "myPVector",
15+
"description": "your PVector object",
16+
"type": ["PVector"]
17+
},
18+
{
19+
"name": "angle",
20+
"description": "the direction of the resultant vector",
21+
"type": ["float"]
22+
}
23+
]
24+
}

0 commit comments

Comments
 (0)