Skip to content

Add JSON file for PVector#setHeading() #621

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

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions content/references/translations/en/processing/PVector.json
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,11 @@
"name": "heading()",
"desc": "Calculate the angle of rotation for this vector"
},
{
"anchor": "PVector_setHeading_",
"name": "setHeading()",
"desc": "Set the direction for this vector"
},
{
"anchor": "PVector_rotate_",
"name": "rotate()",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,18 @@
"brief": "Calculate the angle of rotation for this vector",
"related": [],
"name": "heading()",
"description": "Calculate the angle of rotation for this vector (only 2D vectors)",
"syntax": [".heading()"],
"description": "Calculate the vector's direction, that is, the angle this vector makes\n with the positive X axis (only 2D vectors)",
"syntax": ["myPVector.heading()"],
"returns": "float",
"type": "method",
"category": "pvector",
"subcategory": "method",
"classanchor": "PVector",
"parameters": []
"parameters": [
{
"name": "myPVector",
"description": "your PVector object",
"type": ["PVector"]
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"brief": "Set the direction for this vector",
"related": ["PVector_heading_"],
"name": "setHeading()",
"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.",
"syntax": ["myPVector.setHeading(angle)"],
"returns": "PVector",
"type": "method",
"category": "pvector",
"subcategory": "method",
"classanchor": "PVector",
"parameters": [
{
"name": "myPVector",
"description": "your PVector object",
"type": ["PVector"]
},
{
"name": "angle",
"description": "the direction of the resultant vector",
"type": ["float"]
}
]
}