new GeoLine(Obj, To)
幾何物件:線段
| Name | Type | Description | 
|---|---|---|
Obj | 
            
            
            GeoLine | GeoPoint | undefined | 
                
                 為複製的GeoLine或From。  | 
        
To | 
            
            
            GeoPoint | undefined | 
                
                 若Obj參數為From時此參數為To,否則此參數無意義。  | 
        
Example
var a = new GeoLine(line);
var b = new GeoLine(From, To);
var c = new GeoLine();
    
    
Members
- 
    
readonlyBoundary
 - 
    
    
此幾何的範圍
Properties:
Name Type Description BoundaryGeoBoundary 範圍
 - 
    
readonlyCenter
 - 
    
    
中心點
Properties:
Name Type Description CenterGeoPoint 中心點
 - 
    
From
 - 
    
    
起始點
Properties:
Name Type Description FromGeoPoint 起始點
 - 
    
readonlyLength
 - 
    
    
長度
Properties:
Name Type Description LengthNumber 長度
 - 
    
PolarAngle
 - 
    
    
波拉角,即從起點往終點的向量,此向量的數學角度,單位為角度
Properties:
Name Type Description PolarAngleNumber 波拉角
 - 
    
To
 - 
    
    
終點
Properties:
Name Type Description ToGeoPoint 終點
 - 
    
readonlytype
 - 
    
    
物件型態,值為GEO_TYPE.LINE
Properties:
Name Type Description typeGEO_TYPE 物件型態
 
Methods
- 
    
BackExtend(Distance)
common/Geometry.js, line 4727 - 
    
    
    
線段往後退縮Distance距離。
Name Type Description DistanceNumber 往後退縮的距離。
 - 
    
Classify(p){GEO_STATUS}
common/Geometry.js, line 4403 - 
    
    
    
取得傳入點p與本身的相關位置。
Name Type Description pGeoPoint 欲測試的資料點。
Returns:
Type Description GEO_STATUS 相關位置  - 
    
Clone(){GeoLine}
common/Geometry.js, line 4332 - 
    
    
    
產生一份新的自己。
Returns:
Type Description GeoLine 傳回複製的新的自己。  - 
    
CopyFrom(Obj){GeoLine}
common/Geometry.js, line 4341 - 
    
    
    
複製。
Name Type Description ObjGeoLine 複製的資料源。
Returns:
Type Description GeoLine this  - 
    
Distance(Obj){Number}
common/Geometry.js, line 4617 - 
    
    
    
計算自己與傳入幾何的距離。
Name Type Description ObjGeoPoint | GeoLine | GeoPolyline | GeoPolygon | GeoPolygonSet 要計算距離的幾何資料。
Returns:
Type Description Number 傳回距離。  - 
    
Flip()
common/Geometry.js, line 4520 - 
    
    
    
將此線段的起點與終點對調。
 - 
    
ForwardExtend(Distance)
common/Geometry.js, line 4715 - 
    
    
    
線段往前延展Distance距離。
Name Type Description DistanceNumber 往前延展的距離。
 - 
    
FromGeoJSON(src){Boolean}
common/Geometry.js, line 4791 - 
    
    
    
讀入GeoJSON數值。
Name Type Description srcObject | String GeoJSON物件或字串 。
Returns:
Type Description Boolean 回傳讀取是否成功。  - 
    
GetNearPoint(p, Ret){Number}
common/Geometry.js, line 4641 - 
    
    
    
取得在此線段中,離傳入的點p最近的點Ret。
Name Type Description pGeoPoint 要計算的點。
RetGeoPoint 此為out,要在外面先配置好,會傳回最近的點。
Returns:
Type Description Number 傳回離最近的點的距離。  - 
    
GetPoint(t){GeoPoint}
common/Geometry.js, line 4531 - 
    
    
    
取得從起點往終點方向的某比例的點。
Name Type Description tNumber 欲取出點的比例,此比例可為正或負,單位為線段的長度。
Returns:
Type Description GeoPoint 取出的點  - 
    
Intersect(e, Obj){GEO_STATUS}
common/Geometry.js, line 4488 - 
    
    
    
取得與傳入線段e的相關位置。
Name Type Description eGeoLine 欲比較的線段。
ObjGeoPoint | Object 此為out參數,需先在外面配好變數,回傳時,若為GeoPoint,則為交點,否則Obj.t代表交點離起點的距離,單位為整個線段的比例,也就是0<=Obj.t<=1。
Returns:
Type Description GEO_STATUS 相關位置。  - 
    
IsIntersect(Line, EndPointIncluded, Obj){GEO_STATUS}
common/Geometry.js, line 4568 - 
    
    
    
判斷自己與傳入線段Line是否相交。
Name Type Description LineGeoLine 欲檢查的線段。
EndPointIncludedBoolean 若只交道端點,是否算是相交。
ObjGeoPoint | Object 此為out參數,需先在外面配好變數,回傳時,若為GeoPoint,則為交點,否則Obj.t代表交點離起點的距離,單位為整個線段的比例,也就是0<=Obj.t<=1。
Returns:
Type Description GEO_STATUS 相關位置。  - 
    
MakeBuffer(Delta, PolygonSet){Boolean}
common/Geometry.js, line 4707 - 
    
    
    
做出環域的PolygonSet。
Name Type Description DeltaNumber 環域的距離。
PolygonSetGeoPolygonSet out參數,環域計算的答案。
Returns:
Type Description Boolean 回傳是否成功。  - 
    
Offset(p)
common/Geometry.js, line 4696 - 
    
    
    
將線段位移p。
Name Type Description pGeoPoint 欲位移的距離。
 - 
    
PtInsideLine(p){Boolean}
common/Geometry.js, line 4688 - 
    
    
    
判定點p是否位於線段中。
Name Type Description pGeoPoint 欲判斷的點。
Returns:
Type Description Boolean 傳回判斷的結果。  - 
    
Rot()
common/Geometry.js, line 4504 - 
    
    
    
將此線段以中心點為旋轉中心,逆時針,轉動90度。
 - 
    
SplitBy(Line, 此為out參數,要在外面先配置好,傳回從自己的起點算,所經過的交點,因為是線段,所以最多只會有一個點。, 此為out參數,要在外面先配置好,傳回從傳入的Line起點算,所經過的交點,因為是線段,所以最多只會有一個點。){Number}
common/Geometry.js, line 4742 - 
    
    
    
找出此線段和傳入線段Line的焦點。
Name Type Description LineGeoLine 要計算的線段。
此為out參數,要在外面先配置好,傳回從自己的起點算,所經過的交點,因為是線段,所以最多只會有一個點。Array.<GeoPoint> 此為out參數,要在外面先配置好,傳回從傳入的Line起點算,所經過的交點,因為是線段,所以最多只會有一個點。Array.<GeoPoint> Returns:
Type Description Number 傳回所有交點數量。  - 
    
ToGeoJSON(toString, includeZ){object|String}
common/Geometry.js, line 4768 - 
    
    
    
將幾何輸出成GeoJSON物件或字串。
Name Type Description toStringBoolean 是否把物件轉成JSON字串。
includeZBoolean 是否包含Z,標準GeoJSON不包含Z(可不給,預設false)。
Returns:
Type Description object | String 輸出轉換結果。