<divclass="platform-hinted "data-platform-hinted="data-platform-hinted"><divclass="content sourceset-depenent-content"data-active=""data-togglable=":kmath-complex:dokkaHtmlPartial/commonMain"><divclass="symbol monospace"><spanclass="token keyword"></span><spanclass="token keyword">fun </span><ahref="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-number/index.html">Number</a><spanclass="token punctuation">.</span><ahref="to-quaternion.html"><spanclass="token function">toQuaternion</span></a><spanclass="token punctuation">(</span><spanclass="token punctuation">)</span><spanclass="token operator">: </span><ahref="-quaternion/index.html">Quaternion</a><spanclass="top-right-position"><spanclass="copy-icon"></span><divclass="copy-popup-wrapper popup-to-left"><spanclass="copy-popup-icon"></span><span>Content copied to clipboard</span></div></span></div><pclass="paragraph">Creates a quaternion with real part equal to this real.</p><h4class="">Receiver</h4><pclass="paragraph">the real part.</p><h4class="">Return</h4><pclass="paragraph">a new quaternion.</p><br><divclass="symbol monospace"><spanclass="token keyword"></span><spanclass="token keyword">fun </span><ahref="-complex/index.html">Complex</a><spanclass="token punctuation">.</span><ahref="to-quaternion.html"><spanclass="token function">toQuaternion</span></a><spanclass="token punctuation">(</span><spanclass="token punctuation">)</span><spanclass="token operator">: </span><ahref="-quaternion/index.html">Quaternion</a><spanclass="top-right-position"><spanclass="copy-icon"></span><divclass="copy-popup-wrapper popup-to-left"><spanclass="copy-popup-icon"></span><span>Content copied to clipboard</span></div></span></div><pclass="paragraph">Creates a quaternion with <codeclass="lang-kotlin">w</code>-component equal to <codeclass="lang-kotlin">re</code>-component of given complex and <codeclass="lang-kotlin">x</code>-component equal to <codeclass="lang-kotlin">im</code>-component of given complex.</p><h4class="">Receiver</h4><pclass="paragraph">the complex number.</p><h4class="">Return</h4><pclass="paragraph">a new quaternion.</p></div></div>