Daniel Rooke first realizes he's different when he's five years old. Instead of following along with the multiplication tables in school, Rooke records prime numbers in a special notebook, which his teacher takes from him one day. Several weeks later, a man named Dr. Adair visits Rooke at home to ask him about the prime numbers. Dr. Adair sees potential in Rooke and, several years later, offers him a place at the Naval Academy. On his first night, Rooke is too upset to cry: nobody at the Academy cares about math, and the other boys torment him because his father is a clerk. As time goes on, Rooke learns to hide his cleverness. He learns four languages, discovers he loves astronomy and math, and learns to play the organ. All these subjects appeal to Rooke because of their satisfying logic. Rooke meets Dr. Vickery, the Astronomer Royal, when he's thirteen. Dr. Vickery is just as awkward as Rooke, which Rooke finds comforting. When Rooke finishes school two years later he writes to Dr. Vickery asking for a job, but Dr. Vickery informs him that jobs as an astronomer are few and far between.
Rooke joins the marines and is assigned to the ship Resolution. He meets Talbot Silk on his first day, and Silk declares that they'll be friends. Silk is an outgoing storyteller and with his example, Rooke learns how to make small talk and engage more effectively with others. When the Resolution stops in Antigua, Rooke encounters slaves for the first time and reflects that they're the same as other people, not objects of value. One afternoon, Rooke witnesses the hanging of a lieutenant who was planning a mutiny. The horrifying experience shows Rooke that the British military system will require him to be emotionless and inhuman. Later that year, the Resolution engages in battle with a French ship. Silk and Rooke see the entire lower half of Private Truby's body destroyed, and Rooke is also seriously injured. Rooke returns to Portsmouth to recover, where he feels as though he has no future.
Two years later, Dr. Vickery writes to Rooke and suggests that he volunteer to serve as the astronomer on the First Fleet’s expedition to New South Wales. Rooke learns that Silk will also be joining, and he agrees immediately. When Rooke and Silk meet for the first time since the battle, they realize that their friendship deepened after seeing Private Truby's injuries. Silk shares that he's been commissioned to write an account of his time in New South Wales, and Rooke thinks they're both similarly unsuited to life in the military. On the way to New South Wales, Rooke is a diligent astronomer. He works with Lieutenant Gardiner and the commodore, James Gilbert. Gilbert suffers from chronic pain and seems joyless because of it. When the fleet arrives in New South Wales, Rooke makes sure he's on the first boat to shore with Gilbert, Surgeon Weymark, and Gardiner. When the men get to shore, they encounter five natives, whom they offer trinkets such as mirrors and beads. When the natives seem unimpressed, Weymark demonstrates his sharpshooting abilities and shoots through one of the native's shields. As the four Englishmen laugh, the natives disappear into the woods.
After a few weeks, Gilbert receives a commission appointing him governor of New South Wales, which he reads to all the prisoners and soldiers. Afterwards, to avoid having to police the prisoners, Rooke identifies a high cliff where he hopes to build an observatory. He finds the perfect spot, though Governor Gilbert initially tries to forbid Rooke from building it. Rooke manages to convince Gilbert that observing a comet predicted by Dr. Vickery is of the utmost importance, and Gilbert gives in. The observatory takes months to construct, but when it's done, Rooke feels as though he can finally be himself there. He joins the other officers for Sunday dinner every week, and does his best to avoid the governor, who sometimes joins them as well. One week, the governor announces that he's planning an expedition into the woods to look for more fertile land. Both Rooke and Silk volunteer. On the second day of the expedition, the governor finds a clearing that he deems suitable for farming. That night, a prisoner named Brugden returns from hunting with a black eye. Rooke believes he's lying when he tells Gilbert that the natives attacked him.
A week later, as Rooke takes readings at his observatory, Gardiner comes to visit. He tells Rooke that Gilbert commanded him to capture two native men so that the settlers can learn their language. Gardiner says he wishes he hadn't obeyed the order to violently kidnap them against their will. Rooke reminds Gardiner of their duty as soldiers, but wonders what he would've done in Gardiner's place. The next morning, Rooke goes to the settlement to see the captured natives. He finds Gilbert and Silk talking with the native men, both of whom are in shackles. One man looks curious, while the other looks filled with rage. When Rooke realizes that Silk is acting as a linguist, he becomes jealous and thinks that he’d like to be tasked with that duty. Several weeks later, Silk visits Rooke and informs him that the natives escaped. He then asks Rooke to tell him how they were captured, as Gardiner had refused to tell Silk himself. Rooke deflects, as he knows the truth is extremely dangerous.
When winter comes, Rooke begins sleeping during the day so he can watch for Dr. Vickery's comet at night. When it becomes clear that the comet won't come, Rooke turns to plotting new stars to justify staying at the observatory and away from the others. One morning, Rooke sees two native men standing outside his hut. He sits and waits, and eventually, Warungin comes over and sits next to Rooke and teaches him the name of his tribe (Cadigal). Soon, women and children arrive and look through Rooke's hut. One child, a young girl, seems to share Rooke's enthusiasm for language. She teaches him the word for rain and introduces herself as Tagaran. Rooke organizes a system for recording the Cadigal language, and when the natives return a week later, Tagaran and two other children, Boneda and Worogan, teach Rooke different verbs and parts of the body. Both Tagaran and Rooke are thrilled that they're learning to communicate.
Silk visits Rooke a week later and complains that the governor is going to send him to oversee the farming at Rose Hill. Rooke thinks that he should tell Silk about Tagaran, but doesn't get the chance. Silk shares that Gardiner was sent to Norfolk Island to start a new farming colony there, and Rooke wonders if Gardiner is being punished.
As time passes, Rooke forms close friendships with the natives. Warungin gives Rooke vocabulary lessons, but Tagaran and Rooke have real conversations. One afternoon, she runs into the hut naked and shivering. He ascertains that she's been bathing, and tries to drape his jacket around her shoulders. She twirls out of it, and Rooke feels ashamed, as though he violated her privacy. Tagaran explains that she'll simply dry faster if she stays naked. A few minutes later, the other children arrive and excitedly watch Rooke shave. When he's finished, Tagaran experiments with washing herself in the warm water and Rooke jokes that if she keeps at it she'll become white. That night, she and Worogan spend the night in Rooke's tent. Rooke feels happy and content, and wonders if this is how parents feel about their children. He records the day’s events in his log.
Rooke and everyone else in the settlement are summoned to witness a flogging of a prisoner who stole potatoes. Warungin attends as well, and when the flogger hits the prisoner, Warungin lunges forward and tries to stop it. Rooke realizes that the English system of justice isn't noble and impartial—it's just cruel. Silk returns from Rose Hill later that summer. He tells Rooke all about how boring it was as he rifles through things on Rooke's table. Rooke feels as though he has to tell Silk about Tagaran, but Silk discovers Rooke's notebooks before Rooke has the chance. Silk begins flipping through the notebooks, and soon comes across Rooke’s account of the episode with Tagaran washing herself in his hut. Silk reads into Rooke's minimal notes and wrongly assumes his relationship with Tagaran is sexual. Rooke thinks he doesn't have the words to describe his relationship with Tagaran, but thinks that keeping it a secret has made it look bad. Silk warns Rooke that the governor is concerned for the settlement's safety, and reminds him to be careful with the natives.
A week later, Tagaran, Tugear, and Worogan run into Rooke's hut crying and tell Rooke that a soldier beat Tugear. Rooke tries to imagine himself confronting the responsible ship captain, but he can’t. The girls seem to understand that Rooke won't stand up for them. A week after that, Tagaran asks Rooke to show her how his gun works. Hesitating, he meets her partway, firing the gun without actually shooting a bullet. When she tries to ask him to show her more, he forcibly stops her from grabbing the gun. She runs away, and Rooke thinks he's not going to see her again. He wonders what it's like to be her, and thinks that now the notebooks are all he has of their friendship.
Not long after, a native spears Brugden. Rooke isn't surprised, but is surprised when Silk stops in and asks Rooke to join him on a punitive expedition to capture Carangary, the native man who speared Brudgen, along with six other natives. Rooke refuses to join, but Silk insists that it's an order. He assures Rooke that they won't succeed in capturing any natives, who are too clever to be caught, and then departs. Worried about the expedition, Rooke asks Boneda to send Tagaran to speak with him. When she arrives, Rooke warns her that an expedition is coming to look for Carangary. She warms her hands by the fire, then takes Rookes hands in her own, warming them. She teaches him the word for this action: "putuwa." Rooke takes it as a sign of trust.
Rooke joins the punitive expedition the next morning. He's uneasy when he sees how eager Silk seems to trap the natives, and realizes that Silk’s plan is a good one. Fortunately, Silk's plan doesn't work: when they reach the village, the natives are already gone. Warungin joins the settlers at their camp that night and shares fish with them. As Silk reaches into his pack, Rooke tries to help him but ends up dumping a hatchet and six bags out of the pack. Rooke forces Silk to explain that the governor commanded that Silk was to decapitate six natives and bring back their heads. This news makes Rooke vomit. He then goes to the beach alone to swim. While swimming, he decides he can no longer take part in such violence. He leaves for Sydney that night, and when he arrives, he informs the governor of his decision. The governor is incensed and sends him back to England on the first ship. On his last morning in New South Wales, Rooke sees Tagaran. She warms his hands again and watches his ship until it's gone. He thinks about her 50 years later on his deathbed in Antigua, where he spent much of his adult life freeing slaves. He thinks of Tagaran as a distant star, guiding him even if he can no longer see her.