<meta http-equiv="Content-Type" content="text/html; charset=utf-8"><div dir="ltr">Currently there is no such a function but I think it can be easily implemented. <div><br></div><div>Suppose that ship1 is at p1@t1 and ship2 is at p2@t1. What the value of such a function be at time t1 ?</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Sep 20, 2021 at 2:14 PM <<a href="mailto:suc.eleve@ecole-navale.fr">suc.eleve@ecole-navale.fr</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Thanks for your answer, I missed the temporal distance. But the  <br>
built-in function azimuth is not what I want to do : I would like to  <br>
obtain a tfloat which would correspond at the direction in which ShipA  <br>
see ShipB at each instant.<br>
Best Regards,<br>
<br>
<br>
Esteban Zimanyi <<a>esteban.zimanyi@ulb.be</a>> a écrit :<br>
<br>
> You can use the temporal distance<br>
> <a rel="noreferrer">https://docs.mobilitydb.com/MobilityDB/develop/ch05s17.html</a><br>
> and azimuth functions in MobilityDB<br>
> <a rel="noreferrer">https://docs.mobilitydb.com/MobilityDB/develop/ch05s06.html</a><br>
><br>
> Get the temporal distance<br>
> {point,tpoint} <-> {point,tpoint}: tfloat<br>
> SELECT tgeompoint '[Point(0 0)@2012-01-01, Point(1 1)@2012-01-03)' <-><br>
>   geometry 'Point(0 1)';<br>
> -- "[1@2012-01-01, 0.707106781186548@2012-01-02, 1@2012-01-03)"<br>
> SELECT tgeompoint '[Point(0 0)@2012-01-01, Point(1 1)@2012-01-03)' <-><br>
>   tgeompoint '[Point(0 1)@2012-01-01, Point(1 0)@2012-01-03)';<br>
> -- "[1@2012-01-01, 0@2012-01-02, 1@2012-01-03)"<br>
> SELECT tgeompoint '[Point(0 1)@2012-01-01, Point(0 0)@2012-01-03)' <-><br>
>   tgeompoint '[Point(0 0)@2012-01-01, Point(1 0)@2012-01-03)';<br>
> -- "[1@2012-01-01, 0.707106781186548@2012-01-02, 1@2012-01-03)"<br>
> SELECT tgeompoint '[Point(0 0)@2012-01-01, Point(1 1)@2012-01-02)' <-><br>
>   tgeompoint '[Point(0 1)@2012-01-01, Point(1 2)@2012-01-02)';<br>
> -- "[1@2012-01-01,1@2012-01-02)"<br>
><br>
> Get the temporal azimuth<br>
> azimuth(tpoint): tfloat<br>
> SELECT degrees(azimuth(tgeompoint '[Point(0 0 0)@2012-01-01, Point(1 1<br>
> 1)@2012-01-02,<br>
>   Point(1 1 1)@2012-01-03, Point(0 0 0)@2012-01-04)'));<br>
> -- "Interp=Stepwise;{[45@2012-01-01, 45@2012-01-02], [225@2012-01-03,<br>
> 225@2012-01-04)}"<br>
><br>
><br>
><br>
> On Mon, Sep 20, 2021 at 1:32 PM <<a>suc.eleve@ecole-navale.fr</a>> wrote:<br>
><br>
>> Good afternoon,<br>
>> As my currently working on a project on collision between ships, I<br>
>> would like to build a tfloat which would correspond to the distance<br>
>> between two ships, an other which would correspond to the bearing of<br>
>> one ship saw by the other one. I already have the tgeompoint<br>
>> corresponding to the trajectories of those ships but as I didn't find<br>
>> mobilityDB built-in functions which would directly do what I want, I<br>
>> would like to do that my self. The first step would be to obtain the X<br>
>> and Y coordinates of the tgeompoint into tfloat. But I don't really<br>
>> know how to do that as PosGis function ST_X() only works for points<br>
>> and not trajectories. Then I will also need to apply mathematics<br>
>> functions such as sin()or sqrt() to tfloat, but it seems that for the<br>
>> moment only basic functions such as + or / are supported for tfloat.<br>
>><br>
>> Would someone have solutions for these diverse issues ?<br>
>><br>
>> Best Regards,<br>
>><br>
>> A. Suc<br>
>><br>
>> _______________________________________________<br>
>> Mobilitydb-users mailing list<br>
>> <a>Mobilitydb-users@lists.osgeo.org</a><br>
>> <a rel="noreferrer">https://lists.osgeo.org/mailman/listinfo/mobilitydb-users</a><br>
>><br>
<br>
<br>
<br>
_______________________________________________<br>
Mobilitydb-users mailing list<br>
<a>Mobilitydb-users@lists.osgeo.org</a><br>
<a rel="noreferrer">https://lists.osgeo.org/mailman/listinfo/mobilitydb-users</a><br>
</blockquote></div>