11

public double len(){

double length;

length = Math.sqrt(this.x * this.y);

return length;

public void nor(){

this.x = this.x / length;

this.y = this.y / length;

System.out.println;

public void pri(){

System.out.println;

public class CheckVector2{

public static void main(String args[]){

Vector2 v2 = new Vector2(1,1);

v2.set(3,4);

v2.add(2, 3);

//v2.pri();

v2.sub(2, 3);

v2.mul(2);

System.out.println;

v2.nor();

原文地址:https://www.cnblogs.com/Archon-Cty/p/7754174.html