(1) 實現一個Point類,該類包含表示坐標的兩個int型變量x、y,構造方法Point()和Point(int xx, int yy),返回x值和y值的int getX()和int getY()方法,計算兩點間距離的double distance(Point)方法。其中計算平方根用Math.sqrt()方法。 (2) 實現一個Circle類,該類包含表示圓心的Point型變量center,表示半徑的int radius變量,以及構造方法Circle()、Circle(int xx,int yy,int r)、Circle(Point c,int r),返回周長和面積的int perimeter()、double area()方法,返回兩個圓是否為同一個圓(返回0)、同心圓(返回1)、相交的圓(返回2)、分離的圓(返回3)、包含的圓(返回4)等關系的int relation(Circle c)等方法。PI值可以用Math.PI常量。 (3) 實現測試上述兩個類的ClassTest類。該類在main方法中分別創建若干個Point對象和Circle對象,并調用相關方法,輸出方法的返回值,驗證其正確性。 (4) 將Point類、Circle類和主類的包名分別調整為p1、p2、p3,并重新運行,驗證是否運行正確。
標簽: Point
上傳時間: 2014-11-25
上傳用戶:cylnpy
在MCS51上實現計算器的功能模塊 (完成加減乘除正余弦開方正余切E的冪和對數等的運算,使用了Cx51標準庫函數中Math.h)
上傳時間: 2016-08-28
上傳用戶:541657925
This sample displays a basic integer calculator powered by the 8051 microcontroller. Although Keil C51 has a full floating point Math library the evaluation version is restricted to 2k of object code, so we have constrained this sample to integer Maths in order to fit within this limit. The program for this design was written in C using the Keil uVision 2 IDE for which Proteus VSM provides a Debug Monitor driver. Instructions for configuring Proteus to run in conjunction with the Keil environment can be found by editing the 8051 microcontroller on the schematic (point at it and press CTRL-E) and then clicking on the help button on the Edit Component dialogue form.
標簽: microcontroller calculator Although displays
上傳時間: 2014-12-01
上傳用戶:edisonfather
THE DESIGN PATTERNS JAVA COMPANION 1. Creational Patterns 17 The Factory Pattern 18 How a Factory Works 18 Sample Code 18 The Two Derived Classes 19 Building the Factory 20 Factory Patterns in Math Computation 22 When to Use a Factory Pattern 24 Thought Questions 25 The Abstract Factory Pattern 26 A GardenMaker Factory 26 How the User Interface Works 28 Consequences of Abstract Factory 30 Thought Questions 30 The Singleton Pattern 31 Throwing the Exception 32 Creating an Instance of the Class 32 Static Classes as Singleton Patterns 33 Creating Singleton Using a Static Method 34
標簽: Creational COMPANION PATTERNS Patterns
上傳時間: 2013-12-20
上傳用戶:xwd2010
Part2 using C++ Operators if you are dreading this chapter because you don t like Math_relax. c++ does all your Math for you!it is a miscon ception that you have to be good at Math to understand how to program compters.
標簽: Math_relax Operators you dreading
上傳時間: 2016-10-16
上傳用戶:tonyshao
Part5 using C++ Operators if you are dreading this chapter because you don t like Math_relax. c++ does all your Math for you!it is a miscon ception that you have to be good at Math to understand how to program compters.
標簽: Math_relax Operators you dreading
上傳時間: 2014-01-22
上傳用戶:wlcaption
The DSPLIB is a collection of 39 high-level optimized DSP functions for the TMS320C64x device. This source code library includes C-callable functions (ANSI-C language compatible) for general signal processing Math and vector functions.
標簽: collection high-level functions optimized
上傳時間: 2016-10-16
上傳用戶:趙云興
The DSPLIB is a collection of 39 high-level optimized DSP functions for the TMS320C64x device. This source code library includes C-callable functions (ANSI-C language compatible) for general signal processing Math and vector functions.
標簽: collection high-level functions optimized
上傳時間: 2016-10-16
上傳用戶:gengxiaochao
用20個示例項目的方式介紹Matlab/Simulink。內容包括: *Contains over 20 hands-on projects in MATLAB(with code) integrated throughout the book *Includes a complete introduction to Simulink *Accompanied by a CD-ROM containing MATLAB examples, source code, third party simulations & projects *Suitable for self-study and professional licensing exams *Designed for the reader who does not have extensive Math and programming experience *Contains many practical applications of MATLAB and Simulink
標簽: Contains Simulink hands-on projects
上傳時間: 2014-01-03
上傳用戶:hj_18
The MATLAB Compiler automatically converts MATLAB M-files to C and C++ code. The MATLAB Compiler includes the MATLAB C/C++ Math and Graphics Libraries, which let you automatically convert your MATLAB applications to C and C++ code for stand-alone applications.
標簽: MATLAB Compiler automatically The
上傳時間: 2014-01-09
上傳用戶:凌云御清風