> For the complete documentation index, see [llms.txt](https://guide.cronuszen.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://guide.cronuszen.com/gpcscripting/gpc-script-guide/inputs-and-outputs/polar-sticks.md).

# Polar sticks

{% code title="polar-passthrough.gpc" %}

```cpp
int raw_angle;
int raw_radius;

main {
    raw_angle = get_ipolar(POLAR_RS, POLAR_ANGLE);
    raw_radius = get_ipolar(POLAR_RS, POLAR_RADIUS);

    set_polar(POLAR_RS, raw_angle, raw_radius);
}
```

{% endcode %}

For a virtual/ghost stick:

```cpp
main {
    set_polar2(POLAR_GHOST, 180, 3000);
}
```

Rules:

* Use `get_ipolar` when output must not feed into the next calculation.
* Keep angle in `0..359`.
* `get_ipolar` and `get_polar` expose the high-resolution radius used with `set_polar`.
* Keep `set_polar` radius in `0..32767`.
* Keep `set_polar2` radius in `0..15000`.
* Avoid mixing polar and direct X/Y final writers unless the conversion/precedence is intentional.
* After `block_all_inputs()`, restore both axes of the target physical stick with `set_val(axis, get_ival(axis))` before calling `set_polar()`. Otherwise, nonzero physical input can override the corresponding polar axis. See Interaction with polar output.
* Make the final polar write the last writer for that stick/ghost output.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://guide.cronuszen.com/gpcscripting/gpc-script-guide/inputs-and-outputs/polar-sticks.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
