資源簡(jiǎn)介
3D魔方模型

代碼片段和文件信息
package?com.ake.magiccube;
import?java.awt.geom.Point2D;
/**
?*?
?*?@author?Saturday?2015-9-26
?*?這邊有三維空間坐標(biāo),主要是針對(duì)于空間的。
?*?這邊的三維空間有什么特點(diǎn),我還是不知道,至少是有三個(gè)坐標(biāo)的屬性吧。
?*?其他的就暫時(shí)的不要加上去了。
?*
?*/
public?class?Axis3D?{
private?double?x?yz;
private?Point2D.Double?point;?
private?Axis3D(){
point??=new?Point2D.Double();
}
public?Axis3D(double?x?double?y?double?z)?{
this();
this.x?=?x;
this.y?=?y;
this.z?=?z;
}
public?Axis3D(double[]?position){
this();
this.x?=?position[0];
this.y?=?position[1];
this.z?=?position[2];
}
public?void?setValue(double[]?position){
this.x?=?position[0];
this.y?=?position[1];
this.z?=?position[2];
}
public?void?setValue(Axis3D?a){
this.x=a.getX();
this.y=a.getY();
this.z=a.getZ();
}
public?void?setValue(double?x?double?y?double?z){
this.x=x;
this.y=y;
this.z=z;
}
/**
?*?取得二維平面中對(duì)應(yīng)的三維空間點(diǎn)的坐標(biāo)
?*?@return?Point2D.Double?對(duì)象引用二維平面點(diǎn)對(duì)象
?*/
public?Point2D.Double?getPoint(){
point.setLocation(x?y);
return?point;
}
/**
?*?@return?the?x
?*/
public?double?getX()?{
return?x;
}
/**
?*?@param?x?the?x?to?set
?*/
public?void?setX(double?x)?{
this.x?=?x;
}
/**
?*?@return?the?y
?*/
public?double?getY()?{
return?y;
}
/**
?*?@param?y?the?y?to?set
?*/
public?void?setY(double?y)?{
this.y?=?y;
}
/**
?*?@return?the?z
?*/
public?double?getZ()?{
return?z;
}
/**
?*?@param?z?the?z?to?set
?*/
public?void?setZ(double?z)?{
this.z?=?z;
}
public?boolean?isEquals(Axis3D?other){
if(Math.abs(this.x-other.getX())<0.001
&&Math.abs(this.y-other.getY())<0.001
&&Math.abs(this.z-other.getZ())<0.001)
return?true;
return?false;
}
/*?(non-Javadoc)
?*?@see?java.lang.object#toString()
?*/
@Override
public?String?toString()?{
return?“Axis3D?[“?+?x?+?“?“?+?y?+?“?“?+?z?+?“]“;
}
}
?屬性????????????大小?????日期????時(shí)間???名稱
-----------?---------??----------?-----??----
?????文件???????2053??2015-10-17?23:15??magiccube?complete?version\Axis3D.java
?????文件??????22295??2015-10-19?20:43??magiccube?complete?version\Cube.java
?????文件????????643??2015-10-18?20:13??magiccube?complete?version\CubeComparator.java
?????文件???????7405??2015-10-11?18:34??magiccube?complete?version\CubePanel.java
?????文件??????12569??2015-10-19?21:04??magiccube?complete?version\CubePanel2.java
?????文件??????14278??2015-10-18?16:45??magiccube?complete?version\LittleSquare.java
?????文件???????3505??2015-10-03?22:21??magiccube?complete?version\RotateModel.java
?????文件???????2403??2015-10-11?20:43??magiccube?complete?version\SubFace.java
?????文件????????639??2015-10-14?22:53??magiccube?complete?version\Test.java
?????文件??????19591??2015-10-19?22:06??magiccube?complete?version\WholeCubeModel.java
?????目錄??????????0??2015-10-19?22:06??magiccube?complete?version
-----------?---------??----------?-----??----
????????????????85381????????????????????11
評(píng)論
共有 條評(píng)論