| 
      		
    
           | 
       
      
			Chapter: 1. ソースコードダウンロード, 
						2. テスト結果, 3. テスト項目・方法, 
						4. Test code 
			
  
      1. ソースコードダウンロード 
      =>
            NormalLines.zip, 
						ShortestNormalLines.zip
       
			
  
      2. テスト結果
				戻る=>page top 
      
        
          
             
               | 
           
          
             図1 点から曲線への垂線計算(NormalLines) 
            垂線は一般に複数本ある。これを赤、マゼンダ、緑、・・・  の色で区別する。 
              | 
           
          
             
                | 
           
          
            図2 点から曲線への最短の垂線計算(ShortestNormalLines) 
            点から曲線への最短点計算と同じ。各点ごとに1本(または0本)決まる。 | 
           
        
       
				
  
      
				
  
      3. テスト項目・方法戻る=>page top 
      曲線への垂線を計算するメソッドはCurve2DUtil.getNormalLinesとCurve2DUtil.getShortestNormalLineである。 
      このメソッドは閉図形(境界線が閉じている)ではない直線、折れ線、スプライン曲線の図形選択に使うので、処理速度が重要でリアルタイム操作ができなければならない。もちろん信頼性も重要である。 
        
      public static CurvePT[] getNormalLines(Point2D point, Curve2D curve) 
      引数: 
      point - 与えられた点 
      curve - Curve2D オブジェクト 
      戻り値: 
      pointからcurveへの垂線の足をCurvePT オブジェクトの配列を返す。垂線がないときは長さ0の配列を返す。 
      
  
      4. Test code戻る=>page top 
			 
			4.1 クラス一覧 
			4.1.1 NormalLines 
      
        
          
            | 
             クラス 
             | 
            
             説明 
             | 
           
          
            | 
             NormalLines 
             | 
            
             public class NormalLines extends JFrame 
            Jframe, JScrollPane, JViewport, Panelオブジェクトを作成し組み立てる。 
             | 
           
          
            | NormalLinesPanel | 
            
             public class NormalLinesPanel extends JPanel 
            このオブジェクトの上に図1の図形と指定点から図形への垂線(一般には複数)を描画する。 
             | 
           
					
            | TestCase | 
            
							public class TestCase 
							  
							=> TestCase of the RegionHitTest.
             | 
           
          
            | TestCurve | 
            
							public class TestCurve 
							  
							=> TestCurve of the RegionHitTest.
             | 
           
          
            | パラメトリック曲線 | 
            
              Segment2D, 
							Curve2D, 
							Rectangle2DE, 
							RoundRectangle2DE, 
							Ellipse2DE, 
							Line2DE, 
							Polyline2DE,  
              CubicCurve2DE, GeneralCurve2DE, FergusonCurve2D  | 
           
          
            | 幾何計算ライブラリ | 
            
              Curve2DUtil.getNormalLines,  
							Curve2DUtil.getShortestNormalLine, 
							CurvePT, 
							Matrix, 
							Matrix2D 
            | 
           
        
       
			 
			4.1.2 ShortestNormalLines 
      
        
          
            | 
             クラス 
             | 
            
             説明 
             | 
           
          
            | 
             ShortestNormalLines 
             | 
            
             public class ShortestNormalLines extends JFrame 
            Jframe, JScrollPane, JViewport, Panelオブジェクトを作成し組み立てる。 
             | 
           
          
            | ShortestNormalLinesPanel | 
            
             public class ShortestNormalLinesPanel extends JPanel 
            このオブジェクトの上に図2の図形と指定点からの最短垂線を描画する。 
             | 
           
					
            | TestCase | 
            
							public class TestCase 
							  
							=> TestCase of the RegionHitTest.
             | 
           
          
            | TestCurve | 
            
							public class TestCurve 
							  
							=> TestCurve of the RegionHitTest.
             | 
           
          
            | パラメトリック曲線 | 
            
							NormalLinesと同じ。 | 
           
          
            | 幾何計算ライブラリ | 
            
							NormalLinesと同じ。 | 
           
        
       
			
  
		4.2 クラス仕様
		 
    4.2.1 public class NormalLinesPanel extends JPanel 
      
        
          
            | 
             メソッド 
             | 
            
             説明 
             | 
           
          
            | createTestCase | 
            
             public void createTestCase() 
            TestCaseオブジェクトを作成する。 
             | 
           
          
            | paint | 
            
            public void paint(Graphics g) 
            処理: 
            このクラス(NormalLinesPanel)のオブジェクトに図形と曲線への垂線を描画する(図1)。 
						曲線への垂線計算はCurve2DUtil.getNormalLinesメソッドで実行。
             | 
           
					
        
       
		 
    4.2.2 public class ShortestNormalLinesPanel extends JPanel 
      
        
          
            | 
             メソッド 
             | 
            
             説明 
             | 
           
          
            | createTestCase | 
            
             public void createTestCase() 
            TestCaseオブジェクトを作成する。 
             | 
           
          
            | paint | 
            
							public void paint(Graphics g) 
            処理: 
            このクラス(ShortestNormalLinesPanel)のオブジェクトに図形と曲線への最短垂線を描画する(図2)。 
						曲線への最短垂線計算はCurve2DUtil.getShortestNormalLineメソッドで実行。
             | 
           
					
        
       
       
  
       |