本文整理汇总了TypeScript中common/util.showError函数的典型用法代码示例。如果您正苦于以下问题:TypeScript showError函数的具体用法?TypeScript showError怎么用?TypeScript showError使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了showError函数的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: item
item(i: number): number {
if (0 > i || i >= this.dimension) {
showError("あうと おぶ ばうんず");
throw "あうと おぶ ばうんず";
}
return this.data[i];
}
示例2: mulMatEach
mulMatEach(m: Matrix): this {
if (m.dimension != this.dimension) {
showError("型が違って計算できない");
throw "型が違って計算できない";
}
for (let i = 0; i < this.dimension * this.dimension; i++)
this.data[i] *= m.data[i];
return this;
}
示例3: transform
transform(v: Vector): this {
if (v.dimension != this.dimension) {
showError("次元が違うエラー");
throw "次元が違うエラー";
}
for (let i = 0; i < this.dimension; i++)
this.data[(this.dimension - 1) * this.dimension + i] += v.data[i];
return this;
}
示例4: mulVec
mulVec(v: Vector): this {
if (v.dimension != this.dimension) {
showError("型が違って計算できない");
throw "型が違って計算できない";
}
for (let i = 0; i < this.dimension; i++)
this.data[i] *= v[i];
return this;
}
示例5: mapping
/** for temporal use */
mapping(d: number, map: string): Matrix {
if (d * d != map.length) {
showError("次元が違うエラー");
throw "次元が違うエラー";
}
var keys = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ";
var result = map.split("").map(v => this.data[keys.indexOf(v)]);
return new Matrix(d, result);
}
示例6: scale
scale(v: Vector): this {
if (v.dimension != this.dimension) {
showError("次元が違うエラー");
throw "次元が違うエラー";
}
for (let i = 0; i < this.dimension; i++)
for (let j = 0; j < this.dimension - 1; j++)
this.data[j * this.dimension + i] *= v.data[i];
return this;
}
示例7: padding
padding(m: Matrix, x1: number, y1: number): this {
if (this.dimension < m.dimension - Math.max(x1, y1)) {
showError("次元が違うエラー");
throw "次元が違うエラー";
}
for (let x = x1; x < x1 + m.dimension; x++) {
for (let y = x1; y < y1 + m.dimension; y++) {
this.data[x * this.dimension + y] = m.data[(x - x1) * m.dimension + (y - y1)];
}
}
return this;
}
示例8: constructor
constructor(d: number, array?: number[]) {
this.dimension = d;
if (array == undefined) {
array = new Array(d);
for (let i = 0; i < d; i++)
array[i] = 0;
}
this.data = array;
if (array.length != d) {
showError("Matrix.ts 指定されたarrayの長さが合わない。");
return;
}
}
示例9: showError
/*getPerspective(tonD: number, fovFirstAxis: number, aspects: number[], near: number, far: number, oneAxis: number, devNumAxis: number): this {
var f = Math.tan(Math.PI * 0.5 - 0.5 * fovFirstAxis);
if (tonD != aspects.length + 1 || tonD >= this.dimension) {
showError("次元が違うエラー");
throw "次元が違うエラー";
}
this.getId();
//this.data[x * this.dimension + y];
for (let y = 0; y < tonD; y++) {
this.data[y * this.dimension + y] = y == 0 ? f : f / aspects[y - 1];
}
// tonD番目の要素を計算するための式
this.data[tonD * this.dimension + tonD] = -1; //2 / (far - near);
this.data[oneAxis * this.dimension + tonD] = (near + far) / (near - far); //far / (near - far);
// devNumAxis番目の要素を計算するための式
this.data[tonD * this.dimension + devNumAxis] = near * far / (near - far) * 2 //1;
this.data[devNumAxis * this.dimension + devNumAxis] = 0;
return this;
}*/
slice(x1: number, x2: number, y1: number, y2: number) {
if (x1 > x2 || y1 > y2 || x1 < 0 || y1 < 0 || x2 >= this.dimension || y2 >= this.dimension) {
showError("あうと おぶ ばうんず");
throw "あうと おぶ ばうんず";
}
var result: number[] = [];
for (let y = y1; y <= y2; y++) {
for (let x = x1; x <= x2; x++) {
result.push(this.data[x * this.dimension + y]);
}
}
return result;
}