Source code: com/arranger/jarl/test/frac/ComplexPoint.java
1 ////////////////////////////////////////////////////////////////////////////////
2 // ComplexPoint Class //////////////////////////////////////////////////////////
3 ////////////////////////////////////////////////////////////////////////////////
4 // Copyright 2000 - David Leberknight - Anyone may use this code for any reason
5 // at any time, provided that they give an appropriate reference to this source,
6 // and send David some email ( david@leberknight.com ).
7 //
8 // The ComplexPoint class holds an imaginary (complex) point.
9
10 package com.arranger.jarl.test.frac;
11
12 public class ComplexPoint {
13 private double real;
14 private double imaginary;
15
16 public ComplexPoint(double real, double imaginary) {
17 this.real = real;
18 this.imaginary = imaginary;
19 }
20
21 public ComplexPoint() {
22 real = 0.0;
23 imaginary = 0.0;
24 }
25
26 public double getImaginary() {
27 return imaginary;
28 }
29
30 public double getReal() {
31 return real;
32 }
33
34 public void set(ComplexPoint cp) {
35 real = cp.getReal();
36 imaginary = cp.getImaginary();
37 }
38
39 public void set(double cr, double ci) {
40 real = cr;
41 imaginary = ci;
42 }
43 }