# Form Analysis of cone with FormFittingToolbox (Geodäsie/Vermessung)

I have a set of 3D data took by Laser Scanner on a cone with the following information
The apex of the cone data is (10.156930,-3.498146,-1.440301). The cone was produced in the following parameters
1-Radius of its circle base is 15cm
2-slant height= 30 cm i.e slant height=Diameter of its base
3-height of the cone from apex to the center of its circular base is calculated via Pythagoras theory is 25.981 cm
if you have any question please let me know.
I attached a copy of points here

1 10.186 -3.5936 0.2637
2 10.1824 -3.5788 0.2635
3 10.1864 -3.5802 0.2504
4 10.1838 -3.564 0.2502
5 10.1904 -3.5951 0.2506
6 10.1982 -3.569 0.2373
7 10.1962 -3.5837 0.2374
8 10.1697 -3.5457 0.263
9 10.1713 -3.5316 0.2629
10 10.1832 -3.5505 0.2501
11 10.1749 -3.5608 0.2632
12 10.1713 -3.5032 0.2627
13 10.1853 -3.5224 0.2499
14 10.1707 -3.5173 0.2628
15 10.1876 -3.5373 0.2501
16 10.2286 -3.5375 0.2245
17 10.2197 -3.5486 0.2244
18 10.2033 -3.5428 0.2373
19 10.2021 -3.5571 0.2373
20 10.2032 -3.5286 0.2372
21 10.2059 -3.5017 0.2502
22 10.2322 -3.5107 0.2376
23 10.1712 -3.5314 0.3157
24 10.1836 -3.5636 0.3296
25 10.1777 -3.577 0.2899
26 10.1831 -3.5925 0.2769
27 10.181 -3.5783 0.2767
28 10.1806 -3.5916 0.2901
29 10.1814 -3.5782 0.3164
30 10.1855 -3.5932 0.3035
31 10.1781 -3.5771 0.3031
32 10.1887 -3.6088 0.2904
33 10.1911 -3.6096 0.3037
34 10.1906 -3.5814 0.33
35 10.1842 -3.5359 0.3294
36 10.1666 -3.5445 0.2893
37 10.1702 -3.5591 0.2763
38 10.1641 -3.5437 0.276
39 10.1694 -3.5588 0.2895
40 10.1563 -3.5122 0.2888
41 10.162 -3.5284 0.2758
42 10.1595 -3.5134 0.2757
43 10.1594 -3.5274 0.289
44 10.1724 -3.5464 0.3159
45 10.1717 -3.5596 0.3028
46 10.1692 -3.5454 0.3026
47 10.1797 -3.5489 0.3293
48 10.1747 -3.5605 0.3161
49 10.1638 -3.5147 0.3154
50 10.1617 -3.5282 0.3022
51 10.1578 -3.5127 0.302
52 10.1792 -3.52 0.329
53 10.1642 -3.5005 0.3152
54 10.1853 -3.5077 0.3291
55 10.2114 -3.5733 0.3571
56 10.1971 -3.5683 0.3433
57 10.1936 -3.5537 0.343
58 10.1938 -3.5391 0.3429
59 10.2206 -3.5342 0.3569
60 10.1984 -3.5266 0.3429
61 10.1803 -3.4928 0.2628
62 10.1702 -3.4892 0.3153
63 10.1766 -3.4773 0.3022
64 10.1488 -3.4819 0.3015
65 10.1447 -3.4805 0.2882
66 10.1501 -3.4957 0.2885
67 10.1569 -3.4981 0.2755
68 10.1595 -3.4857 0.2755
69 10.1538 -3.497 0.3017
70 10.1912 -3.4824 0.2762
71 10.1893 -3.4816 0.3158
72 10.1954 -3.4978 0.3293
73 -10.245 3.6582 0.1989
74 10.2488 -3.6741 0.1991
75 10.2409 -3.6277 0.1987
76 10.2437 -3.6437 0.1988
77 10.237 -3.7275 0.266
78 10.2377 -3.6989 0.2257
79 10.2463 -3.702 0.2126
80 10.2453 -3.7166 0.226
81 10.2396 -3.7285 0.2527
82 10.2449 -3.7305 0.2394
83 10.2453 -3.7456 0.2663
84 10.2229 -3.6934 0.2654
85 10.2387 -3.7141 0.2392
86 10.231 -3.6964 0.2389
87 10.2305 -3.711 0.2657
88 10.233 -3.712 0.2524
89 10.227 -3.6949 0.2522
90 10.2189 -3.6778 0.2652
91 10.2302 -3.6674 0.2254
92 10.242 -3.6863 0.2124
93 10.2397 -3.6708 0.2122
94 10.2337 -3.6833 0.2255
95 10.2216 -3.6357 0.225
96 10.2355 -3.6548 0.2121
97 10.2318 -3.6394 0.2119
98 10.2261 -3.6514 0.2252
99 10.2116 -3.6606 0.2649
100 10.216 -3.6622 0.2516
101 10.2216 -3.6643 0.2385
102 10.2215 -3.6788 0.2519
103 10.2266 -3.6807 0.2387
104 10.2001 -3.6279 0.2643
105 10.2095 -3.6453 0.2514
106 10.2169 -3.648 0.2383
107 10.2053 -3.6298 0.2512
108 10.2126 -3.6325 0.2381
109 10.2054 -3.6439 0.2646
110 10.2137 -3.6035 0.2246
111 10.2184 -3.6196 0.2248
112 10.2259 -3.6078 0.2116
113 10.2288 -3.6233 0.2117
114 10.226 -3.5943 0.2115
115 10.2131 -3.5897 0.2245
116 10.1992 -3.6127 0.2509
117 10.2078 -3.6158 0.2379
118 10.2575 -3.6627 0.1858
119 10.2604 -3.7221 0.1995
120 10.2517 -3.6899 0.1992
121 10.2668 -3.7095 0.1862
122 10.264 -3.6944 0.1861
123 10.2557 -3.7055 0.1994
124 10.2602 -3.6783 0.1859
125 10.273 -3.6683 0.1727
126 10.2726 -3.6828 0.1728
127 10.2568 -3.6484 0.1857
128 10.2512 -3.7328 0.2262
129 10.257 -3.735 0.2129
130 10.2526 -3.7193 0.2128
131 10.286 -3.5574 0.199
132 10.2711 -3.5665 0.1988
133 10.2972 -3.5756 0.186
134 10.2831 -3.5855 0.1858
135 10.3122 -3.5665 0.1862
136 10.3405 -3.5763 0.1733
137 10.3239 -3.5849 0.1731
138 10.3583 -3.5679 0.1735
139 10.349 -3.5937 0.16
140 10.3026 -3.5486 0.1993
141 10.3435 -3.5347 0.1999
142 10.374 -3.5596 0.1737
143 10.3197 -3.5409 0.1995
144 10.3297 -3.558 0.1864
145 10.3706 -3.544 0.187
146 10.3475 -3.5505 0.1866
147 10.297 -3.5044 0.239
148 10.2768 -3.5396 0.2121
149 10.261 -3.5487 0.2119
150 10.2926 -3.5315 0.2123
151 10.2644 -3.5218 0.2251
152 10.2892 -3.516 0.2255
153 10.2642 -3.5075 0.2383
154 10.3388 -3.5047 0.2398
155 10.3195 -3.5121 0.2261
156 10.3162 -3.5253 0.2127
157 10.3547 -3.5101 0.2268
158 10.3454 -3.5209 0.2133
159 10.3754 -3.5312 0.2004
160 10.3793 -3.5185 0.2139
161 10.3781 -3.5029 0.2675
162 10.391 -3.5073 0.2409
163 10.3862 -3.5057 0.2542
164 10.2197 -3.6779 0.3185
165 10.2133 -3.661 0.3181
166 10.2393 -3.7282 0.3195
167 10.2357 -3.7269 0.2927
168 10.2434 -3.7448 0.2796
169 10.2361 -3.7271 0.2793
170 10.2425 -3.7444 0.293
171 10.2228 -3.6933 0.292
172 10.2293 -3.7105 0.279
173 10.2217 -3.6929 0.2787
174 10.2289 -3.7104 0.2923
175 10.2491 -3.7468 0.3199
176 10.2448 -3.7452 0.3064
177 10.2369 -3.7274 0.306
178 10.2252 -3.6941 0.3188
179 10.2313 -3.7112 0.3058
180 10.2226 -3.6932 0.3053
181 10.2342 -3.7122 0.3192
182 10.2101 -3.6599 0.3047
183 10.209 -3.6596 0.2914
184 10.2171 -3.6772 0.2784
185 10.2096 -3.6598 0.2781
186 10.2169 -3.677 0.2918
187 10.1966 -3.6267 0.2908
188 10.2029 -3.6429 0.2778
189 10.1975 -3.627 0.2775
190 10.2025 -3.6427 0.2911
191 10.2172 -3.6771 0.3051
192 10.2009 -3.628 0.3175
193 10.2041 -3.6433 0.3044
194 10.1974 -3.6269 0.3041
195 10.206 -3.6439 0.3178
196 10.2468 -3.6875 0.3727
197 10.2435 -3.7297 0.333
198 10.2433 -3.7005 0.3594
199 10.2368 -3.7131 0.3326
200 10.2297 -3.6956 0.3322
201 10.2428 -3.7153 0.3462
202 10.2359 -3.6978 0.3458
203 10.243 -3.6715 0.3724
204 10.2178 -3.6626 0.3316
205 10.2334 -3.6681 0.3587
206 10.2314 -3.6821 0.3455
207 10.2254 -3.68 0.332
208 10.225 -3.6651 0.3451
209 10.2379 -3.6844 0.359
210 10.2139 -3.6326 0.3444
211 10.2106 -3.6455 0.3312
212 10.2059 -3.6298 0.3309
213 10.2242 -3.6362 0.3581
214 10.2189 -3.6484 0.3448
215 10.229 -3.652 0.3584
216 10.2481 -3.6295 0.3855
217 10.2393 -3.6556 0.3721
218 10.2361 -3.6404 0.3719
219 10.2477 -3.6149 0.3853
220 10.2178 -3.6045 0.3576
221 10.2091 -3.6159 0.3442
222 10.22 -3.6197 0.3578
223 10.2311 -3.6091 0.3713
224 10.2325 -3.624 0.3716
225 10.2308 -3.5954 0.3712
226 10.2372 -3.5689 0.3711
227 10.2321 -3.5805 0.3711
228 10.2511 -3.6598 0.3859
229 10.2559 -3.676 0.3863
230 10.2501 -3.732 0.3466
231 10.2523 -3.7479 0.3334
232 10.2573 -3.7346 0.3602
233 10.2501 -3.7179 0.3598
234 10.2597 -3.7213 0.3735
235 10.2591 -3.6919 0.3866
236 10.2516 -3.7034 0.3731
237 10.2621 -3.7072 0.3868
238 10.2501 -3.6453 0.3857
239 10.2995 -3.5469 0.3862
240 10.2494 -3.6019 0.3852
241 10.2566 -3.5756 0.3851
242 10.2517 -3.5873 0.3851
243 10.2659 -3.5641 0.3853
244 10.296 -3.5322 0.3726
245 10.2662 -3.5078 0.3448
246 10.3031 -3.506 0.3459
247 10.2862 -3.5004 0.332
248 10.2988 -3.5189 0.3592
249 10.2788 -3.5543 0.3856
250 10.2504 -3.5445 0.3713
251 10.2726 -3.5377 0.3719
252 10.3539 -3.5376 0.388
253 10.3282 -3.5146 0.3601
254 10.3438 -3.506 0.3471
255 10.3736 -3.516 0.3615
256 10.3235 -3.5415 0.387
257 10.3253 -3.5279 0.3735
258 10.3589 -3.525 0.3746
259 10.3827 -3.5043 0.3214
260 10.3891 -3.5352 0.3891
261 10.3998 -3.51 0.3353
262 10.4012 -3.5253 0.376
263 10.2725 -3.7109 0.4006
264 10.2725 -3.6967 0.4005
265 10.2669 -3.6654 0.3999
266 10.2692 -3.6808 0.4001
267 10.2837 -3.6713 0.4139
268 10.2834 -3.6571 0.4137
269 10.2653 -3.6356 0.3995
270 10.2664 -3.6511 0.3997
271 10.2867 -3.6286 0.4135
272 10.285 -3.6425 0.4136
273 10.3077 -3.636 0.4278
274 10.3156 -3.625 0.4279
275 10.3531 -3.5516 0.4015
276 10.2989 -3.6037 0.4137
277 10.2686 -3.6086 0.3993
278 10.2666 -3.6215 0.3994
279 10.2746 -3.5953 0.3993
280 10.291 -3.6164 0.4135
281 10.2799 -3.5836 0.3994
282 10.3065 -3.5929 0.4138
283 10.2914 -3.5729 0.3996
284 10.3076 -3.5642 0.4001
285 10.3365 -3.5741 0.4146
286 10.3189 -3.5824 0.4141
287 10.3578 -3.5669 0.4153
288 10.3239 -3.6124 0.4281
289 10.3331 -3.6021 0.4283
290 10.347 -3.5921 0.4287
291 10.3627 -3.5831 0.4291
292 10.3278 -3.5566 0.4007
293 10.3833 -3.5476 0.4025
294 10.3093 -3.4946 0.2658
295 10.3074 -3.4938 0.3192
296 10.3003 -3.4914 0.3056
297 10.2941 -3.4893 0.2921
298 10.2975 -3.4905 0.2789
299 10.2714 -3.4954 0.3182
300 10.3204 -3.4981 0.3329

When I run form Analysis I get this error

"calculation aborted, iteration number has reached maximum (mx/dx =2.378) would you like to see the last solution?"
When I see the results, I am not happy with them, the results are below

Mx -2.1365351525671425E101 4.521714915674703E107
My 1.071731588619541E103 3.2421176945238745E107
Mz -3.158557035901203E104 1.6721323004422976E109
Nx -1.9370277395419443E57 1.0132840697398966E62
Ny 6.459944725626762E56 5.158241053604849E61
Nz 9.757738059587159E55 5.352742149415428E60
α 4.658765802558264 1807.8486620172077

Any help is highly appreciated.....

Regards

## Form Analysis of cone with FormFittingToolbox

"calculation aborted, iteration number has reached maximum (mx/dx =2.378) would you like to see the last solution?"

The Value is 2.378E+104 - note the E+104.

First, I check your date and make a simple sketch.

It is easy to see, that there is a leverage point far away from the point group. You have to eliminate outliers or, if you know the reason, revise the points. In your case, I belive it is a typing error. The sign of point 73 is interchanged:

72 10.1954 -3.4978 0.3293
73 -10.245 3.6582 0.1989
74 10.2488 -3.6741 0.1991

I changed it to:

73 10.245 -3.6582 0.1989

and got the following solution with the FormFittingToolbox:

Mx 10.135203018 0.000548132
My -3.469062048 0.000988097
Mz  0.292279887 0.000588639
Nx -0.784882919 0.001796108
Ny  0.619618011 0.002276894
Nz  0.005685347 0.002481430
α   2.610069091 0.002119551

The apex of the cone data is (10.156930,-3.498146,-1.440301).

Check your a priori information about the apex, because there is no point with a z-value nether 1m.

kind regards
Micha

--
applied-geodesy.org - OpenSource Least-Squares Adjustment Software for Geodetic Sciences

## Form Analysis of cone with FormFittingToolbox

Hello Micha

Sorry for being late on replying to your nice solution, yes it is true that point73 is outlier, how I couldnt notice it.

Thanks a lot for your effort I highly appreciate it.

Can I ask what Nx, Ny, Nz, α are refer to cause I know that Mx, My, & Mz is the centre of the cone.

Are there any formula for cone in 3D space or can I do my least square my solve. I need to understand the matrix how it was build in to least square solution.

Regards

## Form Analysis of cone with FormFittingToolbox

first, please don't send an email to the forum-adress. You got this mail, because you enabled the notification-option.

Can I ask what Nx, Ny, Nz, α are refer to cause I know that Mx, My, & Mz is the centre of the cone.

The vector is the rotation-axis of the cone. This vector is also an unit-vector. The point lies on . The angle describes the angle between the vector and the curved surface area of the cone. Therefore, the formula describes a cone with infinite length.

Are there any formula for cone in 3D space

There are some other ones e.g. in Sung Joon Ahn: Least Squares Orthogonal Distance Fitting of Curves and Surfaces in Space.

I need to understand the matrix how it was build in to least square solution.

I used a so-called rigorous Gauss-Helmert model (general least-squares) e.g. Charles D. Ghilani, Paul R. Wolf: Adjustment Computations - Spatial Data Analysis.

kind regards
Micha

--
applied-geodesy.org - OpenSource Least-Squares Adjustment Software for Geodetic Sciences

## Form Analysis of cone with FormFittingToolbox

Hello Michael

Thanks for your clarification and it seems that the subject is not that ease that I imagined I will do some literature...
Regards

## Form Analysis of cone with FormFittingToolbox

Hello Sarhat,

No problem. If it is helpfull to see the source-code, you get it on sf.net e.g. Cone.java. You can extract the formula from line 173:

it seems that the subject is not that ease that I imagined I will do some literature...

It is simple enough, belive me. If you have questions, you can ask me here.

cu
Micha

--
applied-geodesy.org - OpenSource Least-Squares Adjustment Software for Geodetic Sciences

## Form Analysis of cone with FormFittingToolbox

Hello Michael

This is me again, I think you helped me better than what I thought and I really feel that I bothered you by asking you too question but I thing it will be a last question that I ask. My question is can I get the Cone.Java working separately from the javagraticule3d or it is just a source code that I need to compile it in C++ and run it from their.

Regards

## Form Analysis of cone with FormFittingToolbox

Hello Sarhat,

can I get the Cone.Java working separately from the javagraticule3d

Do you mean a single adjustment-tool (cone only) without a GUI which can be start in bash-mode like:

application.jar myPointSourceFile.txt myReport.txt

I can compile a simple console-version, if you want.

or it is just a source code that I need to compile it in C++ and run it from their.

No, there are some dependent files. If you only translate the cone.java it will not run.

regards
Micha

--
applied-geodesy.org - OpenSource Least-Squares Adjustment Software for Geodetic Sciences

## Form Analysis of cone with FormFittingToolbox

Yes Please I really need to run a single adjustment-tool (cone only) without a GUI

and as I understand any bash command line should work likw Python or do I need only the

application.jar myPointSourceFile.txt myReport.txt.

I highly appreciate if you can compile console-version it it is not a time consuming for you

Regards

## Form Analysis of cone with FormFittingToolbox

Hi,

please find here the command line version (cone only): ConeFFT.zip.

The application needs at least one argument - the point-file. Optional, you can define a (path to the) report file (default report.txt) and a damping parameter (default 0). I add two batch files (ConeFit.bat for Windows; ConeFit.sh for Linux) to show you the usecase.

Choose one of the follwing commands to start the adjustment.

java -jar -Xms200m -Xmx500m ConeFFT.jar points.txt
java -jar -Xms200m -Xmx500m ConeFFT.jar points.txt report.txt
java -jar -Xms200m -Xmx500m ConeFFT.jar points.txt report.txt 0


Hope it works. Let me know, if you have any problems! If it works and you are pleased with the adjustment results, please refer to Java Graticule 3D.

kind regards
Micha

Source-code for archive:

 /**********************************************************************
*                     FormFittingToolboxConsole                        *
************************************************************************
* Copyright (C) by Michael Loesler, http//derletztekick.com            *
*                                                                      *
* This program is free software; you can redistribute it and/or modify *
* the Free Software Foundation; either version 3 of the License, or    *
* (at your option) any later version.                                  *
*                                                                      *
* This program is distributed in the hope that it will be useful,      *
* but WITHOUT ANY WARRANTY; without even the implied warranty of       *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
* GNU General Public License for more details.                         *
*                                                                      *
* You should have received a copy of the GNU General Public License    *
* along with this program; if not, see <http://www.gnu.org/licenses/>  *
* or write to the                                                      *
* Free Software Foundation, Inc.,                                      *
* 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.            *
*                                                                      *
**********************************************************************/

package com.derletztekick.geodesy.formFittingToolbox.v2.console;

import java.io.File;
import java.util.Locale;

import com.derletztekick.geodesy.formFittingToolbox.v2.FormManager;
import com.derletztekick.geodesy.formFittingToolbox.v2.form.Form;
import com.derletztekick.geodesy.formFittingToolbox.v2.form.form3d.Cone;

public class FormFittingToolboxConsole {

/**
* @param args
*/
public static void main(String[] args) {
double levmar = 0;
File pointFile  = null;
File exportFile = new File("report.txt");
if (args.length > 0)
pointFile = new File(args[0]);
if (args.length > 1)
exportFile = new File(args[1]);
if (args.length > 2)
try {levmar = Double.parseDouble(args[2]);} catch(NumberFormatException nfe) {nfe.printStackTrace();}

FormManager formManager = new FormManager(null, Locale.getDefault());
formManager.setDimension(3);
formManager.setFormClass(Cone.class);

formManager.setPointFile(pointFile);
formManager.setLevMarDampingValue(Math.abs(levmar));
Form form = formManager.createForm();

int status = form.estimateModel();
System.out.println(status==1?"\n\nEstimation successfully finished!":"\n\nEstimation failed!");
if (status == 1)
formManager.exportFormParametersToFile(exportFile);
}

}


--
applied-geodesy.org - OpenSource Least-Squares Adjustment Software for Geodetic Sciences

## Form Analysis of cone with FormFittingToolbox

Hello Michael

I am really not sure how to describe my thanks to you, you are really a generous person and gentleman. I hope from all my heart that you find a success in your entire life. I wish you all success. Yes, it is perfectly work in cygwin from Win7.

Regards

## Form Analysis of cone with FormFittingToolbox

Hi Sarhat,

Yes, it is perfectly work in cygwin from Win7.

You don't need cygwin to run this application. Do you have installed the java runtime enviroment on your win7 computer (and is this installation in your environment variable)?

You can test your installation online - Check to ensure that you have the recommended version of Java installed for your operating system.

If the test failed, please install the current version from http://java.com/ for win7. Check your installed version and open a command line window and tip:

java -version

If you get an answer like java is an unknown command, the java-command is unknown. You can add the bin-directory (e.g. c:\java\jre\bin\) to your environment variables or you work with the absolute path like:

c:\java\jre\bin\java -jar -Xms200m -Xmx500m ConeFFT.jar points.txt

Hope it works!

kind regards
Micha

--
applied-geodesy.org - OpenSource Least-Squares Adjustment Software for Geodetic Sciences

## Form Analysis of cone with FormFittingToolbox

Hello Maichael

Yes I have Java installed on my pc and I used that solution and it is perfectly working and I opened the report which I can see the parameters. The only question that I stuck on is how I can use those parameters for finding the apex (x, y, Z) of the cone.

Regards

## Form Analysis of cone with FormFittingToolbox

Hallo,

he only question that I stuck on is how I can use those parameters for finding the apex (x, y, Z) of the cone.

I plot your points (blue) and add the vector m (red) from my solution to the plot. Do you dissatisfied with m?

regards
Micha

--
applied-geodesy.org - OpenSource Least-Squares Adjustment Software for Geodetic Sciences

Tags:
Cone, FormFittingToolbox, Apex

## Form Analysis of cone with FormFittingToolbox

Hello Micahael

Yes I can see it should be the best solution but finaly I think it depends on the dens of points distribution around the cone I also draw them in AutoCad and I can see the position clearly with small amount shifted toward dense points. But is suppose to be the best solution.

Regards

## Form Analysis of cone with FormFittingToolbox

Hi,

I think it depends on the dens of points distribution

Yes, but I don't have other information about the cone during the adjustment-process.

But is suppose to be the best solution.

... with your points. Of course, it is possible, that you get a better solution with a homogeneous point cloud but thats not the only influence on the estimated parameters.

kind regards
Micha

--
applied-geodesy.org - OpenSource Least-Squares Adjustment Software for Geodetic Sciences