# Store complex value in PointData

**URL:** https://discourse.vtk.org/t/store-complex-value-in-pointdata/5355
**Category:** Support
**Tags:** file-formats
**Created:** [March 10, 2021, 12:11am UTC](https://discourse.vtk.org/t/store-complex-value-in-pointdata/5355 "2021-03-10T00:11:19Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![cean\_wang](https://discourse.vtk.org/user_avatar/discourse.vtk.org/cean_wang/32/2570_2.png) [@cean\_wang](https://discourse.vtk.org/u/cean_wang)
#### Post date: [March 10, 2021, 12:11am UTC](https://discourse.vtk.org/t/store-complex-value-in-pointdata/5355/1 "2021-03-10T00:11:19Z")

</div>

Hi,

I want to store Complex Displacement Vector in PointData. For each point, there is Magnitude and Phase value of displacement(T) in X(T1),Y(T2) and Z(T3) axis. What is the format? Is it:  
T1Mag,T1Phase,T2Mag,T2Phase,T3Mag,T3Phase

Or

T1Mag,T2Mag,T3Mag,T1Phase,T2Phase,T3Phase

Or is it depends on what software is used to open it? I want to use Paraview.

Cheers,

Cean

---

<div class="post-metadata">

### Author: ![Yohann\_Bearzi](https://discourse.vtk.org/user_avatar/discourse.vtk.org/yohann_bearzi/32/671_2.png) [@Yohann\_Bearzi](https://discourse.vtk.org/u/Yohann_Bearzi)
#### Post date: [March 11, 2021, 5:18pm UTC](https://discourse.vtk.org/t/store-complex-value-in-pointdata/5355/2 "2021-03-11T17:18:39Z")

</div>

If you want to store complex values, you should use them as 2D vectors (x, y) such that z = x + i y. Complex numbers are not very well handled in VTK or ParaView, so what you are dealing with when you do that is just a plain 2D vector.

If you need to be able to do operations on those complex numbers in C++, I would advise implementing them somewhere in your program and use them. You can find an example of some complex number operation implementation at the beginning of the header `Imaging/Fourier/vtkImageFourierFilter.h` in the VTK repo.

Edit:  
So in your point data, you would have `X1, Y1, X2, Y2...`
