<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>gikan</author_name>
  <author_url>https://blog.hatena.ne.jp/gikan/</author_url>
  <blog_title>(やりこれ出張所)ほうれんそう</blog_title>
  <blog_url>https://gikan.hatenadiary.org/</blog_url>
  <categories>
    <anon>C</anon>
    <anon>C++</anon>
  </categories>
  <description>メモ。正規化する関数は無限ループで止まる可能性があるので注意です。 （追記：こちらの雑記で修正版を書きました） float RadianNormalize(float rad) { float d; if (rad &gt; 0) d = -PI * 2; else d = PI * 2; // ラジアンを正規化する while (!(0.0 &lt;= rad &amp;&amp; rad &lt; PI * 2)) rad += d; return rad; } ついでに上記のものを使って、角度の差を出すソース。 float DiffRadian(float src0, float src1) { float rad = …</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fgikan.hatenadiary.org%2Fentry%2F20080316%2Fp2&quot; title=&quot;角度を正規化するソースコード - (やりこれ出張所)ほうれんそう&quot; class=&quot;embed-card embed-blogcard&quot; scrolling=&quot;no&quot; frameborder=&quot;0&quot; style=&quot;display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;&quot;&gt;&lt;/iframe&gt;</html>
  <image_url></image_url>
  <provider_name>Hatena Blog</provider_name>
  <provider_url>https://hatena.blog</provider_url>
  <published>2008-03-16 00:00:01</published>
  <title>角度を正規化するソースコード</title>
  <type>rich</type>
  <url>https://gikan.hatenadiary.org/entry/20080316/p2</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
