1 package org.simantics.datatypes.literal;
3 import org.simantics.databoard.Bindings;
4 import org.simantics.databoard.binding.Binding;
5 import org.simantics.databoard.util.Bean;
8 final public class Vec2i extends Bean {
10 public static final Binding BINDING = Bindings.getBindingUnchecked(Vec2i.class);
15 public Vec2i(int x, int y) {
21 public boolean isZero() {
25 public double norm1() {
26 return Math.abs(x) + Math.abs(y);
29 public double norm2() {
30 return Math.sqrt(x*x+y*y);
33 public double length() {
37 public double dot(Vec2i other) {
38 return x*other.x + y*other.y;
41 public Vec2i sum(Vec2i other) {
42 return new Vec2i(x + other.x , y + other.y);
46 public String toString() {
47 return "Vec2i[x=" + x + ", y=" + y + "]";