From 81bd5788a892eab850c083757a5447ea289ce2d4 Mon Sep 17 00:00:00 2001 From: Subhraman Sarkar Date: Wed, 26 Mar 2025 09:37:28 +0530 Subject: [PATCH 1/3] Add JSON file for PVector#setHeading() --- .../en/processing/PVector_setHeading_.json | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 content/references/translations/en/processing/PVector_setHeading_.json 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"] + } + ] +} From c712e687826753c60f6a749a7833dbd6dee45d93 Mon Sep 17 00:00:00 2001 From: Subhraman Sarkar Date: Wed, 26 Mar 2025 14:14:56 +0530 Subject: [PATCH 2/3] Add setHeading() in PVector JSON --- content/references/translations/en/processing/PVector.json | 5 +++++ 1 file changed, 5 insertions(+) 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()", From 8018e7ea3c2874837e9761dac064a9b3310201f5 Mon Sep 17 00:00:00 2001 From: Subhraman Sarkar Date: Wed, 26 Mar 2025 14:24:44 +0530 Subject: [PATCH 3/3] Elucidate PVector#heading() --- .../translations/en/processing/PVector_heading_.json | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) 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"] + } + ] }