> For the complete documentation index, see [llms.txt](https://www.opal-rt.com/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://www.opal-rt.com/docs/scopeview/use-functions/mathematical-functions/mathematical-or-phaseshift.md).

# Mathematical | PHASESHIFT

## **PHASE SHIFT – \[PHASESHIFT]**

Outputs the phase difference between two vectors in degrees.

## **CATEGORY**

Mathematical

<figure><img src="https://1028368895-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FfwfLeQP2Iaoefor0ZUNi%2Fuploads%2F1vkyub0F3aN3tlrVwxMl%2Fimage.png?alt=media&amp;token=249a82e1-a9aa-4e77-8558-1b12b81bb51f" alt=""><figcaption></figcaption></figure>

## **DESCRIPTION**

Outputs the phase difference between two vectors in degrees. Output is always between -180 and 180 degrees. When modules(magnitudes) are negatives, it has the same effect as rotating the vector by 180 degrees.

## **RESULT VARIABLES AND PARAMETERS**

<table data-header-hidden><thead><tr><th width="130.79998779296875">Phase_Shift</th><th width="313.199951171875">Phase difference [degrees]</th></tr></thead><tbody><tr><td><strong>Module 1</strong></td><td>Module of the first vector</td></tr><tr><td><strong>Phase 1</strong></td><td>Phase of the first vector [degrees]</td></tr><tr><td><strong>Module 2</strong></td><td>Module of the second vector</td></tr><tr><td><strong>Phase 2</strong></td><td>Phase of the second vector [degrees]</td></tr></tbody></table>

## **SYNTAX**

**pshift**=phaseshift(mag1,ang1,mag2,ang2)

## **CHARACTERISTICS**

Data type support\
Double Floating point

## **EXAMPLE**

<figure><img src="https://1028368895-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FfwfLeQP2Iaoefor0ZUNi%2Fuploads%2F29xz7VeWwSLW8ldpH2QA%2Fimage.png?alt=media&amp;token=7cf419a9-70d6-40df-819d-b0f958773337" alt=""><figcaption></figcaption></figure>


---

# 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://www.opal-rt.com/docs/scopeview/use-functions/mathematical-functions/mathematical-or-phaseshift.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
