2
GeoGebra - Dynamic Mathematics for Everyone
3
http://www.geogebra.org
5
This file is part of GeoGebra.
7
This program is free software; you can redistribute it and/or modify it
8
under the terms of the GNU General Public License as published by
9
the Free Software Foundation.
14
* AlgoMidpointConic.java
16
* Created on 11. November 2001, 21:37
19
package geogebra.kernel;
23
* Center of a conic section.
25
public class AlgoCenterConic extends AlgoElement {
30
private static final long serialVersionUID = 1L;
31
private GeoConic c; // input
32
private GeoPoint midpoint; // output
34
AlgoCenterConic(Construction cons, String label, GeoConic c) {
37
midpoint = new GeoPoint(cons);
38
setInputOutput(); // for AlgoElement
41
midpoint.setLabel(label);
44
protected String getClassName() {
45
return "AlgoCenterConic";
49
protected void setInputOutput() {
50
input = new GeoElement[1];
53
output = new GeoElement[1];
55
setDependencies(); // done by AlgoElement
65
protected final void compute() {
67
midpoint.setUndefined();
72
case GeoConic.CONIC_CIRCLE :
73
case GeoConic.CONIC_ELLIPSE :
74
case GeoConic.CONIC_HYPERBOLA :
75
case GeoConic.CONIC_SINGLE_POINT :
76
case GeoConic.CONIC_INTERSECTING_LINES :
77
midpoint.setCoords(c.b.x, c.b.y, 1.0d);
82
midpoint.setUndefined();
86
final public String toString() {
87
StringBuffer sb = new StringBuffer();
88
// Michael Borcherds 2008-03-30
89
// simplified to allow better Chinese translation
90
sb.append(app.getPlain("CenterOfA",c.getLabel()));
2
GeoGebra - Dynamic Mathematics for Everyone
3
http://www.geogebra.org
5
This file is part of GeoGebra.
7
This program is free software; you can redistribute it and/or modify it
8
under the terms of the GNU General Public License as published by
9
the Free Software Foundation.
14
* AlgoMidpointConic.java
16
* Created on 11. November 2001, 21:37
19
package geogebra.kernel;
21
import geogebra.euclidian.EuclidianConstants;
25
* Center of a conic section.
27
public class AlgoCenterConic extends AlgoElement {
32
private static final long serialVersionUID = 1L;
33
private GeoConic c; // input
34
private GeoPoint midpoint; // output
36
AlgoCenterConic(Construction cons, String label, GeoConic c) {
39
midpoint = new GeoPoint(cons);
40
setInputOutput(); // for AlgoElement
43
midpoint.setLabel(label);
46
public String getClassName() {
47
return "AlgoCenterConic";
50
public int getRelatedModeID() {
51
return EuclidianConstants.MODE_MIDPOINT;
55
protected void setInputOutput() {
56
input = new GeoElement[1];
59
output = new GeoElement[1];
61
setDependencies(); // done by AlgoElement
71
protected final void compute() {
73
midpoint.setUndefined();
78
case GeoConic.CONIC_CIRCLE :
79
case GeoConic.CONIC_ELLIPSE :
80
case GeoConic.CONIC_HYPERBOLA :
81
case GeoConic.CONIC_SINGLE_POINT :
82
case GeoConic.CONIC_INTERSECTING_LINES :
83
midpoint.setCoords(c.b.x, c.b.y, 1.0d);
88
midpoint.setUndefined();
92
final public String toString() {
93
// Michael Borcherds 2008-03-30
94
// simplified to allow better Chinese translation
95
return app.getPlain("CenterOfA",c.getLabel());