# How to initialize a GeometryBasics.Point{2, Float32} that contains no point?

**URL:** https://discourse.julialang.org/t/how-to-initialize-a-geometrybasics-point-2-float32-that-contains-no-point/67701
**Category:** General Usage
**Tags:** question
**Created:** [September 4, 2021, 6:11pm UTC](https://discourse.julialang.org/t/how-to-initialize-a-geometrybasics-point-2-float32-that-contains-no-point/67701 "2021-09-04T18:11:00Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![GoH](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/goh/32/28770_2.png) [@GoH](https://discourse.julialang.org/u/GoH)
#### Post date: [September 4, 2021, 6:11pm UTC](https://discourse.julialang.org/t/how-to-initialize-a-geometrybasics-point-2-float32-that-contains-no-point/67701/1 "2021-09-04T18:11:00Z")

</div>

I am trying to initialize an empty GeometryBasics.Point{2, Float32}, could anyone help?

---

<div class="post-metadata">

### Author: ![Sukera](https://avatars.discourse-cdn.com/v4/letter/s/ce7236/32.png) [@Sukera](https://discourse.julialang.org/u/Sukera)
#### Post date: [September 4, 2021, 6:24pm UTC](https://discourse.julialang.org/t/how-to-initialize-a-geometrybasics-point-2-float32-that-contains-no-point/67701/2 "2021-09-04T18:24:25Z")

</div>

What would a point without coordinates look like? How do you want to use it?

---

<div class="post-metadata">

### Author: ![lazarusA](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/lazarusa/32/6571_2.png) [@lazarusA](https://discourse.julialang.org/u/lazarusA)
#### Post date: [September 4, 2021, 6:27pm UTC](https://discourse.julialang.org/t/how-to-initialize-a-geometrybasics-point-2-float32-that-contains-no-point/67701/3 "2021-09-04T18:27:58Z")

</div>

I think is just ` point = Point2f0[]` .

---

<div class="post-metadata">

### Author: ![lmiq](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/lmiq/32/18314_2.png) [@lmiq](https://discourse.julialang.org/u/lmiq)
#### Post date: [September 4, 2021, 6:36pm UTC](https://discourse.julialang.org/t/how-to-initialize-a-geometrybasics-point-2-float32-that-contains-no-point/67701/4 "2021-09-04T18:36:12Z")

</div>

You can’t initialize an empty point, but you can initialize an empty array of points, which is what @lazarusA suggested.

---

<div class="post-metadata">

### Author: ![sijo](https://avatars.discourse-cdn.com/v4/letter/s/da6949/32.png) [@sijo](https://discourse.julialang.org/u/sijo)
#### Post date: [September 5, 2021, 11:04am UTC](https://discourse.julialang.org/t/how-to-initialize-a-geometrybasics-point-2-float32-that-contains-no-point/67701/6 "2021-09-05T11:04:22Z")

</div>

> [@lazarusA](#):
>
> Point2f0

Note that with the latest version it’s now `Point2f[]`.

---

<div class="post-metadata">

### Author: ![GoH](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/goh/32/28770_2.png) [@GoH](https://discourse.julialang.org/u/GoH)
#### Post date: [September 5, 2021, 11:10am UTC](https://discourse.julialang.org/t/how-to-initialize-a-geometrybasics-point-2-float32-that-contains-no-point/67701/7 "2021-09-05T11:10:00Z")

</div>

thank you!

is there document of Point2f function? was trying to search but didn’t find it…

---

<div class="post-metadata">

### Author: ![lmiq](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/lmiq/32/18314_2.png) [@lmiq](https://discourse.julialang.org/u/lmiq)
#### Post date: [September 5, 2021, 11:16am UTC](https://discourse.julialang.org/t/how-to-initialize-a-geometrybasics-point-2-float32-that-contains-no-point/67701/8 "2021-09-05T11:16:45Z")

</div>

Note that that is a syntax sugar for

```julia
GeometryBasics.Point{2, Float32}[]

```

It is not something different. Maybe that was not clear.

---

<div class="post-metadata">

### Author: ![sijo](https://avatars.discourse-cdn.com/v4/letter/s/da6949/32.png) [@sijo](https://discourse.julialang.org/u/sijo)
#### Post date: [September 5, 2021, 11:45am UTC](https://discourse.julialang.org/t/how-to-initialize-a-geometrybasics-point-2-float32-that-contains-no-point/67701/9 "2021-09-05T11:45:43Z")

</div>

GeometryBasics is still underdocumented unfortunately. As pointed by @lmiq `Point2f` is an alias for `Point{2, Float32}`. You can see this easily in the REPL:

```julia
julia> Point2f
Point{2, Float32}

```

Typing `?Point2f` or `?Point` shows the help:

```julia
help?> Point2f
search: Point2f Point2 Pointf Point4f Point3f Point1f Point4 Point3 Point1 Point pointer PointMeta pointmeta PointWithUV

  No documentation found.

  Summary
  ≡≡≡≡≡≡≡≡≡

  struct Point{S, T}

...

```

So although there is no documentation written for `Point`, we can see it’s the name of a struct type. The type name can be used as a function to instantiate the type, it’s called a constructor (see the manual [here](https://docs.julialang.org/en/v1/manual/constructors/)). But when you write `Point2f[]` you don’t use `Point2f` as a function (constructor), but simply as a type name, just like we write `Int[]` to declare an empty array of `Int`.
