# Struggling with a Point type for several dimensions

**URL:** <https://discourse.julialang.org/t/struggling-with-a-point-type-for-several-dimensions/18066>\
**Category:** New to Julia\
**Tags:** first-steps\
**Created:** [November 27, 2018, 2:16pm UTC](https://discourse.julialang.org/t/struggling-with-a-point-type-for-several-dimensions/18066 "2018-11-27T14:16:57Z")\
**Posts on this page:** 1\
**Showing post:** 18

<div class="post-metadata">

**Author:** ![ajp](https://avatars.discourse-cdn.com/v4/letter/a/c4cdca/32.png) [@ajp](https://discourse.julialang.org/u/ajp)\
**Post date:** [November 28, 2018, 11:55am UTC](https://discourse.julialang.org/t/struggling-with-a-point-type-for-several-dimensions/18066/18 "2018-11-28T11:55:45Z")

</div>

Ok. Happy to be wrong. So I have this type (no mutable before struct):

```julia
struct Point3D <: FieldVector{3, Float64}
    x::Float64
    y::Float64
    z::Float64
end

```

How do I cleanly update only one component of that type and replace the existing type with the newly modified one so:  
p1 = Point3D(1.0, 2.0, 3.0)  
p1 = p1.x + 1.0 ?? Gives p1 as a scalar  
Confused, surely not:  
p1 = ((p1.x + 1.0, p1.y, p1.z))

---

_[View the full topic](https://discourse.julialang.org/t/struggling-with-a-point-type-for-several-dimensions/18066)._
