You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session. Dismiss alert
Metaballs, not to be confused with meatballs, are organic looking squishy gooey blobs. From a mathematical perspective they are an iso-surface. They are rendered using equations such as f(x,y,z) = r / ((x - x0)2 + (y - y0)2 + (z - z0)2). Jamie Wong has a fantastic tutorial on rendering metaballs with canvas. We can replicate the metaball effect using CSS & SVG by applying both blur and contrast fi
コンプガチャが話題になっています。 コンプガチャにハマりやすい理由として「最初は当たりやすいが、だんだん確率が低くなる」という指摘があります。 なぜ「確率が低くなる」という現象おきるのでしょうか。 この記事ではコンプガチャの裏側にある確率マジックを分かりやすく解説します。 サイコロの面を全部そろえるゲーム いちばん身近な確率といえばサイコロです。 サイコロを使ったこんなゲームを考えてみます。 サイコロ コンプのルールサイコロを 1 回振るには 10 円が必要。6 つの面をすべてを出せば、500ml のペットボトル飲料をプレゼント。 「サイコロの 6 つの面をすべてコンプしよう」というゲームなので、シンプルな「コンプガチャ」といえます。 このゲーム、あなたなら参加しますか? 6 つの面を全部だせばよいので、運がよければ 6 回(60円)でペットボトルが手に入ります。なんだかお得そうです。 た
日本中の実装者の中で最も数学能力が低い人間によるQRコードRS符号実装(1) できるだけ分かりやすく書こうとしたところ、作文用紙にして実に200枚近い、軽めの文庫本ほどの長文となりましたので、記事を分割しています。本来は1つの文章として書いたものです。 このところ、紙媒体などを中心に「QRコード」なるものを頻繁に見かけるようになりました。この言葉に聞き覚えのない方も、おそらく実物なら目にしたことがあるはずです。ご存じない方のために簡単に解説しておきますと、「QRコード」とはデンソーウェーブの登録商標で、「JIS X 0510」及び「ISO/IEC 18004」で規格化されています。マトリックス二次元型の2ビットパターンで、高速読み取り及び一定のデータ破損耐久性を前提として開発されたものです。 余計に分からない、との声が聞こえてきそうですが、要するに二次元バーコードです。モザイク模様としてデ
「SHA1ハッシュってあるだろう?」 放課後、いつものように情報処理室に行くと、高山先輩が嬉しそうな顔でそう言った。 「ええ、SHA1、ありますね」 「SHA1って何桁か覚えているかい?」 「えっと…」 一年下の後輩、岡村が口を開いた。 「50桁くらいはありましたっけ…?」 先輩はパソコンに向かって何かを打ちはじめた。 現在、情報部の部員は三人しかいない。部長の高山先輩と、二年の自分と、後輩の岡村だ。いや、正確に言うと、先輩の学年にはもう少しいたのだが、もうほとんど部室に来ることはなくなってしまった。無理もない、この季節になると先輩たちは受験勉強で忙しくなる。 「例えば、こういうふうに… 適当なSHA1の長さを…」 echo -n | openssl sha1 | awk '{print length}' 部長だけは今も部活に来てこうやって色々なことを教えてくれている。本人曰く、普通に勉強
乱数チューニングによる動きのコク 1. 一様乱数 いわゆるMath関数による乱数。 雑味や臭みが強く、そのままでは使い物にならない。 2. 雑味を取り除いた乱数 下処理として臭みや雑味を取り除いた状態。一様乱数特有の発作的なガタツキがないのがわかるだろうか? 過去2フレームに、距離33%以内の重複数が出ないようになっている。 シャッフルやスロットのアニメ処理など、2連続で同じ数字が重なるとバグって見える表現に有効。 3. コクのある乱数 乱数の旨味が濃縮された状態。中心極限定理により、自然な風合いに濃縮されている。 加算式による天然の正規分布は、ボックスミューラー法の養殖された乱数と違い、加算回数で生産者ごとの味わいが出せる。 パーティィクルや自然シミュレーションと相性が良い。 4. 芳醇なまろ味を出した乱数 口に含んだ後に、豊かな香りが広がる乱数。移動平均により連続性を出すことで、揺らぎ
プログラムで使うことの多い「乱数」。ゲーム開発やビジュアルアート、ウェブサイトのアニメーションにおいて乱数は非常に重要で、さまざまな用途で利用されています。プログラムで一般に乱数と聞くと、すべての数値が同じ頻度(分布)で出現する「一様乱数」と呼ばれる乱数をイメージする方が多いと思います。 多くの場合はこの「一様乱数」で取得した乱数を用いれば十分でしょう。しかし、場合によっては「一様乱数」ではなく、偏りのある乱数を用いることでコンテンツの見た目や現象の「自然さ」を演出することが可能です。 実は「一様乱数」に一手間加えることで、乱数の分布の偏りを制御できます。今回は乱数を使用して好みの分布を得るためのパターンをいくつか紹介します。 乱数分布のシミュレーションデモ (HTML5製) 次のデモはリアルタイムで乱数の出現頻度を計算し、グラフに可視化するコンテンツです。画面下のプルダウンで乱数の種類を
2015年12月17日、Google Chrome の JavaScript エンジン(処理系)である V8 の公式ブログにて、 JavaScript の標準的な乱数生成APIである Math.random() の背後で使われているアルゴリズムの変更がアナウンスされました。 Math.random() 関数は JavaScript を利用する際には比較的よく使われる関数ですので、親しみのある方も多いのではないかと思います。 新たなバグの発見や、従来より優秀なアルゴリズムの発見によってアルゴリズムが変更されること自体はそれほど珍しくはないものの、 技術的には枯れていると思われる Math.random() のような基本的な処理の背後のアルゴリズムが変更されたことに驚きを感じる方も少なくないかと思いますが、 それ以上に注目すべきはその変更後のアルゴリズムです。 実際に採用されたアルゴリズムの原
2015年11月10日 プレイヤーが自然に感じる乱数の作り方 Tweet ゲームでは擬似乱数がよく使われるが、ある種のゲームは数学的に精度の高い擬似乱数(たとえばMT)を用いているにも関わらず、コンピュータが有利になるように乱数を操作していると批判に晒されている。 実際、数学的に正しい乱数と、プレイヤーが自然と感じる乱数には、ある種の差が存在する。北陸科学技術大学院大学の池田研究室では、プレイヤーに自然に感じる乱数の生成に関する研究を行っている。 プレイヤーが不自然に感じる理由 数学的に正しい乱数に対してプレイヤーが不自然に感じる理由としては認知バイアスが考えられる。特に本事象に関連する認知バイアスとして、次が挙げられている[1]。 確証バイアス: 人は自分のもつ仮説に一致する情報を求め、反証となる証拠を避ける傾向がある。ひとたび、サイコロが操作されていると感じると、それ以降、その仮説に都
C や C# そして Ruby や Java などでは、実数を整数に丸める際、 単純にキャストしますと切り捨てますが、 round 関数で丸める際に、挙動が異なります。 Python: Ruby: C#: (自作のシェル経由でごめんなさい) C や Ruby, Java では四捨五入がデフォルトで行われますが、 C# では、銀行丸めがデフォルトで行われます。 正式名称は 「最近接偶数への丸め」と言いますが、 「銀行丸め」のほか、「JIS丸め」「ISO丸め」とも言われます。 [Wikipedia の解説記事] JIS丸めとは? http://homepage1.nifty.com/s_miyake/hp/jisround.htm JIS Z 8401 http://www.jisc.go.jp/app/pager?id=94037 上の記事の文章を用いて、簡単に説明すれば、 N桁で丸める場合
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く