# Is There a TGraph3D class or similar one?

**URL:** <https://root-forum.cern.ch/t/is-there-a-tgraph3d-class-or-similar-one/62687>\
**Category:** Newbie\
**Tags:** root\
**Created:** [January 17, 2025, 8:57am UTC](https://root-forum.cern.ch/t/is-there-a-tgraph3d-class-or-similar-one/62687 "2025-01-17T08:57:02Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Crisps](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/crisps/32/39101_2.png) [@Crisps](https://root-forum.cern.ch/u/Crisps)\
**Post date:** [January 17, 2025, 8:57am UTC](https://root-forum.cern.ch/t/is-there-a-tgraph3d-class-or-similar-one/62687/1 "2025-01-17T08:57:02Z")

</div>

Dear experts

I have a set of points f(x, y, s) that I want to do an interpolation, I know I can do this for f(x,y) by `TGraph2D::Interpolation()`, is there a similar `TGraph3D` to do it?

---

<div class="post-metadata">

**Author:** ![couet](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/couet/32/12037_2.png) [@couet](https://root-forum.cern.ch/u/couet)\
**Post date:** [January 17, 2025, 9:21am UTC](https://root-forum.cern.ch/t/is-there-a-tgraph3d-class-or-similar-one/62687/2 "2025-01-17T09:21:11Z")

</div>

TGraph2D takes (x, y, z) points as inputs. The TGraph2D interpolation is based on Delaunay triangles. It assume that for one (x, y) coordinate there only one z coordinate (ie: duplicate (x,y) points are forbidden). There is no ROOT class interpolating random (x, y, z) clouds of points.

---

<div class="post-metadata">

**Author:** ![Crisps](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/crisps/32/39101_2.png) [@Crisps](https://root-forum.cern.ch/u/Crisps)\
**Post date:** [January 17, 2025, 9:40am UTC](https://root-forum.cern.ch/t/is-there-a-tgraph3d-class-or-similar-one/62687/3 "2025-01-17T09:40:50Z")

</div>

Thank you, I meant a set points that were (x, y, s, f(x, y, s)). Can some class do interpolation for this? 3 input 1 output

---

<div class="post-metadata">

**Author:** ![couet](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/couet/32/12037_2.png) [@couet](https://root-forum.cern.ch/u/couet)\
**Post date:** [January 17, 2025, 9:54am UTC](https://root-forum.cern.ch/t/is-there-a-tgraph3d-class-or-similar-one/62687/4 "2025-01-17T09:54:36Z")

</div>

Ah ok. may be the GL classes:

[https://root.cern/doc/v622/glparametric\_8C\_source.html](https://root.cern/doc/v622/glparametric_8C_source.html)  
[https://root.cern/doc/master/gltf3\_8C\_source.html](https://root.cern/doc/master/gltf3_8C_source.html)

---

<div class="post-metadata">

**Author:** ![Crisps](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/crisps/32/39101_2.png) [@Crisps](https://root-forum.cern.ch/u/Crisps)\
**Post date:** [January 18, 2025, 10:36am UTC](https://root-forum.cern.ch/t/is-there-a-tgraph3d-class-or-similar-one/62687/5 "2025-01-18T10:36:55Z")

</div>

I had a look at links you shared, but seems they all use a analytic function to describ. The set of points I got can not (or I don’t know how) be describ by a analytic function, so I’m looking for something just like `TGraph2D::Interpolation()` but is 3D version.

---

<div class="post-metadata">

**Author:** ![couet](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/couet/32/12037_2.png) [@couet](https://root-forum.cern.ch/u/couet)\
**Post date:** [January 20, 2025, 8:56am UTC](https://root-forum.cern.ch/t/is-there-a-tgraph3d-class-or-similar-one/62687/6 "2025-01-20T08:56:28Z")

</div>

There is not equivalent (triangle interpolation) for 3D data set. Have you tried to fill a TH3 with you points ?
