diff --git a/content/references/translations/en/processing/PVector.json b/content/references/translations/en/processing/PVector.json index 384ce411..f5f0f94f 100644 --- a/content/references/translations/en/processing/PVector.json +++ b/content/references/translations/en/processing/PVector.json @@ -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()", diff --git a/content/references/translations/en/processing/PVector_heading_.json b/content/references/translations/en/processing/PVector_heading_.json index 064400b4..37ddbd6c 100644 --- a/content/references/translations/en/processing/PVector_heading_.json +++ b/content/references/translations/en/processing/PVector_heading_.json @@ -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"] + } + ] } diff --git a/content/references/translations/en/processing/PVector_setHeading_.json b/content/references/translations/en/processing/PVector_setHeading_.json new file mode 100644 index 00000000..a4f3d275 --- /dev/null +++ b/content/references/translations/en/processing/PVector_setHeading_.json @@ -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"] + } + ] +}