
エントリーの編集

エントリーの編集は全ユーザーに共通の機能です。
必ずガイドラインを一読の上ご利用ください。
記事へのコメント0件
- 注目コメント
- 新着コメント
このエントリーにコメントしてみましょう。
注目コメント算出アルゴリズムの一部にLINEヤフー株式会社の「建設的コメント順位付けモデルAPI」を使用しています

- バナー広告なし
- ミュート機能あり
- ダークモード搭載
関連記事
numpyで綺麗な円を描く - Qiita
import math, cv2, numpy as np # r must be greater than 0. def circle(r): c = math.ceil(r - 1) s =... import math, cv2, numpy as np # r must be greater than 0. def circle(r): c = math.ceil(r - 1) s = c * 2 + 1 return np.clip(r - np.sqrt(np.sum((np.stack(( np.tile(np.arange(s), (s, 1)), np.repeat(np.arange(s), s).reshape((-1, s)) )) - c) ** 2, axis=0)), 0, 1) # r must be greater than 0. width must be greater than 0 and less than r. def outline_circle(r, width): circ = circle(r) icirc = circle(r - w